| ... | ... | @@ -28,8 +28,13 @@ pub const File = struct { |
| 28 | 28 | pub const async_block_allowed_no = if (io.is_async) false else {}; |
| 29 | 29 | |
| 30 | 30 | pub const Mode = os.mode_t; |
| 31 | |
| 32 | /// The type that is used to represent the inode/file index number. On windows this is a |
| 33 | /// LARGE_INTEGER (i64), and on linux this is a u64. |
| 31 | 34 | pub const INode = switch (builtin.os.tag) { |
| 32 | 35 | .windows => os.windows.LARGE_INTEGER, |
| 36 | // TODO: Handle possibility of 128 bit numbers? ReFS on windows server 2012 uses a 128 bit file |
| 37 | // index. See https://docs.microsoft.com/en-us/windows/win32/api/fileapi/ns-fileapi-by_handle_file_information |
| 33 | 38 | else => u64, |
| 34 | 39 | }; |
| 35 | 40 | |
| ... | ... | @@ -149,7 +154,16 @@ pub const File = struct { |
| 149 | 154 | } |
| 150 | 155 | |
| 151 | 156 | pub const Stat = struct { |
| 157 | /// A number that the system uses to point to the file metadata. This number is not guaranteed to be |
| 158 | /// unique across time, as some file systems may reuse an inode after it's file has been deleted. |
| 159 | /// Some systems may change the inode of a file over time. |
| 160 | /// |
| 161 | /// On Linux, the inode _is_ structure that stores the metadata, and the inode _number_ is what |
| 162 | /// you see here: the index number of the inode. |
| 163 | /// |
| 164 | /// The FileIndex on Windows is similar. It is a number for a file that is unique to each filesystem. |
| 152 | 165 | inode: INode, |
| 166 | |
| 153 | 167 | size: u64, |
| 154 | 168 | mode: Mode, |
| 155 | 169 | |