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 {...@@ -29,15 +29,6 @@ pub const File = struct {
2929
30 pub const Mode = os.mode_t;30 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
41 pub const default_mode = switch (builtin.os.tag) {32 pub const default_mode = switch (builtin.os.tag) {
42 .windows => 0,33 .windows => 0,
43 else => 0o666,34 else => 0o666,
...@@ -162,7 +153,7 @@ pub const File = struct {...@@ -162,7 +153,7 @@ pub const File = struct {
162 /// you see here: the index number of the inode.153 /// you see here: the index number of the inode.
163 ///154 ///
164 /// The FileIndex on Windows is similar. It is a number for a file that is unique to each filesystem.155 /// 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
167 size: u64,158 size: u64,
168 mode: Mode,159 mode: Mode,
lib/std/os/bits/windows.zig+1
...@@ -4,6 +4,7 @@ usingnamespace @import("../windows/bits.zig");...@@ -4,6 +4,7 @@ usingnamespace @import("../windows/bits.zig");
4const ws2_32 = @import("../windows/ws2_32.zig");4const ws2_32 = @import("../windows/ws2_32.zig");
55
6pub const fd_t = HANDLE;6pub const fd_t = HANDLE;
7pub const ino_t = LARGE_INTEGER;
7pub const pid_t = HANDLE;8pub const pid_t = HANDLE;
8pub const mode_t = u0;9pub const mode_t = u0;
910