| ... | @@ -28,6 +28,10 @@ pub const File = struct { | ... | @@ -28,6 +28,10 @@ pub const File = struct { |
| 28 | pub const async_block_allowed_no = if (io.is_async) false else {}; | 28 | pub const async_block_allowed_no = if (io.is_async) false else {}; |
| 29 | | 29 | |
| 30 | pub const Mode = os.mode_t; | 30 | pub const Mode = os.mode_t; |
| | 31 | pub const INode = switch (builtin.os.tag) { |
| | 32 | .windows => os.windows.LARGE_INTEGER, |
| | 33 | else => u64, |
| | 34 | }; |
| 31 | | 35 | |
| 32 | pub const default_mode = switch (builtin.os.tag) { | 36 | pub const default_mode = switch (builtin.os.tag) { |
| 33 | .windows => 0, | 37 | .windows => 0, |
| ... | @@ -145,6 +149,7 @@ pub const File = struct { | ... | @@ -145,6 +149,7 @@ pub const File = struct { |
| 145 | } | 149 | } |
| 146 | | 150 | |
| 147 | pub const Stat = struct { | 151 | pub const Stat = struct { |
| | 152 | inode: INode, |
| 148 | size: u64, | 153 | size: u64, |
| 149 | mode: Mode, | 154 | mode: Mode, |
| 150 | | 155 | |
| ... | @@ -174,6 +179,7 @@ pub const File = struct { | ... | @@ -174,6 +179,7 @@ pub const File = struct { |
| 174 | else => return windows.unexpectedStatus(rc), | 179 | else => return windows.unexpectedStatus(rc), |
| 175 | } | 180 | } |
| 176 | return Stat{ | 181 | return Stat{ |
| | 182 | .inode = info.InternalInformation.IndexNumber, |
| 177 | .size = @bitCast(u64, info.StandardInformation.EndOfFile), | 183 | .size = @bitCast(u64, info.StandardInformation.EndOfFile), |
| 178 | .mode = 0, | 184 | .mode = 0, |
| 179 | .atime = windows.fromSysTime(info.BasicInformation.LastAccessTime), | 185 | .atime = windows.fromSysTime(info.BasicInformation.LastAccessTime), |
| ... | @@ -187,6 +193,7 @@ pub const File = struct { | ... | @@ -187,6 +193,7 @@ pub const File = struct { |
| 187 | const mtime = st.mtime(); | 193 | const mtime = st.mtime(); |
| 188 | const ctime = st.ctime(); | 194 | const ctime = st.ctime(); |
| 189 | return Stat{ | 195 | return Stat{ |
| | 196 | .inode = st.ino, |
| 190 | .size = @bitCast(u64, st.size), | 197 | .size = @bitCast(u64, st.size), |
| 191 | .mode = st.mode, | 198 | .mode = st.mode, |
| 192 | .atime = @as(i64, atime.tv_sec) * std.time.ns_per_s + atime.tv_nsec, | 199 | .atime = @as(i64, atime.tv_sec) * std.time.ns_per_s + atime.tv_nsec, |