authorgravatar for leroycepearson@geemili.xyzLeRoyce Pearson <leroycepearson@geemili.xyz> 2020-03-08 21:52:36-06:00
committergravatar for leroycepearson@geemili.xyzLeRoyce Pearson <leroycepearson@geemili.xyz> 2020-03-08 21:52:36-06:00
log25d9ab95dd8a691963453c4507d519051eaebb0c
treec6f1b91f2e5f85707d049c9a4a12b06928cd8f8a
parentcb84875eed42b4721de5b2cc356c4a6719eb0516

Use os.ino_t for everything

Also, define ino_t for windows

2 files changed, 2 insertions(+), 10 deletions(-)

lib/std/fs/file.zig+1-10
......@@ -29,15 +29,6 @@ pub const File = struct {
2929
3030 pub const Mode = os.mode_t;
3131
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.
34 pub const INode = switch (builtin.os.tag) {
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
38 else => os.ino_t,
39 };
40
4132 pub const default_mode = switch (builtin.os.tag) {
4233 .windows => 0,
4334 else => 0o666,
......@@ -162,7 +153,7 @@ pub const File = struct {
162153 /// you see here: the index number of the inode.
163154 ///
164155 /// The FileIndex on Windows is similar. It is a number for a file that is unique to each filesystem.
165 inode: INode,
156 inode: os.ino_t,
166157
167158 size: u64,
168159 mode: Mode,
lib/std/os/bits/windows.zig+1
......@@ -4,6 +4,7 @@ usingnamespace @import("../windows/bits.zig");
44const ws2_32 = @import("../windows/ws2_32.zig");
55
66pub const fd_t = HANDLE;
7pub const ino_t = LARGE_INTEGER;
78pub const pid_t = HANDLE;
89pub const mode_t = u0;
910