Commit 4159add4ab
Changed files (12)
lib
std
test
src
lib/std/Build/Step/InstallDir.zig
@@ -80,8 +80,8 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {
const cwd = fs.cwd();
switch (entry.kind) {
- .Directory => try cwd.makePath(dest_path),
- .File => {
+ .directory => try cwd.makePath(dest_path),
+ .file => {
for (self.options.blank_extensions) |ext| {
if (mem.endsWith(u8, entry.path, ext)) {
try dest_builder.truncateFile(dest_path);
lib/std/crypto/Certificate/Bundle.zig
@@ -169,7 +169,7 @@ pub fn addCertsFromDir(cb: *Bundle, gpa: Allocator, iterable_dir: fs.IterableDir
var it = iterable_dir.iterate();
while (try it.next()) |entry| {
switch (entry.kind) {
- .File, .SymLink => {},
+ .file, .sym_link => {},
else => continue,
}
lib/std/fs/file.zig
@@ -35,17 +35,17 @@ pub const File = struct {
pub const Gid = os.gid_t;
pub const Kind = enum {
- BlockDevice,
- CharacterDevice,
- Directory,
- NamedPipe,
- SymLink,
- File,
- UnixDomainSocket,
- Whiteout,
- Door,
- EventPort,
- Unknown,
+ block_device,
+ character_device,
+ directory,
+ named_pipe,
+ sym_link,
+ file,
+ unix_domain_socket,
+ whiteout,
+ door,
+ event_port,
+ unknown,
};
/// This is the default mode given to POSIX operating systems for creating
@@ -329,32 +329,32 @@ pub const File = struct {
const mtime = st.mtime();
const ctime = st.ctime();
const kind: Kind = if (builtin.os.tag == .wasi and !builtin.link_libc) switch (st.filetype) {
- .BLOCK_DEVICE => Kind.BlockDevice,
- .CHARACTER_DEVICE => Kind.CharacterDevice,
- .DIRECTORY => Kind.Directory,
- .SYMBOLIC_LINK => Kind.SymLink,
- .REGULAR_FILE => Kind.File,
- .SOCKET_STREAM, .SOCKET_DGRAM => Kind.UnixDomainSocket,
- else => Kind.Unknown,
+ .BLOCK_DEVICE => .block_device,
+ .CHARACTER_DEVICE => .character_device,
+ .DIRECTORY => .directory,
+ .SYMBOLIC_LINK => .sym_link,
+ .REGULAR_FILE => .file,
+ .SOCKET_STREAM, .SOCKET_DGRAM => .unix_domain_socket,
+ else => .unknown,
} else blk: {
const m = st.mode & os.S.IFMT;
switch (m) {
- os.S.IFBLK => break :blk Kind.BlockDevice,
- os.S.IFCHR => break :blk Kind.CharacterDevice,
- os.S.IFDIR => break :blk Kind.Directory,
- os.S.IFIFO => break :blk Kind.NamedPipe,
- os.S.IFLNK => break :blk Kind.SymLink,
- os.S.IFREG => break :blk Kind.File,
- os.S.IFSOCK => break :blk Kind.UnixDomainSocket,
+ os.S.IFBLK => break :blk .block_device,
+ os.S.IFCHR => break :blk .character_device,
+ os.S.IFDIR => break :blk .directory,
+ os.S.IFIFO => break :blk .named_pipe,
+ os.S.IFLNK => break :blk .sym_link,
+ os.S.IFREG => break :blk .file,
+ os.S.IFSOCK => break :blk .unix_domain_socket,
else => {},
}
if (builtin.os.tag == .solaris) switch (m) {
- os.S.IFDOOR => break :blk Kind.Door,
- os.S.IFPORT => break :blk Kind.EventPort,
+ os.S.IFDOOR => break :blk .door,
+ os.S.IFPORT => break :blk .event_port,
else => {},
};
- break :blk .Unknown;
+ break :blk .unknown;
};
return Stat{
@@ -391,7 +391,7 @@ pub const File = struct {
.inode = info.InternalInformation.IndexNumber,
.size = @bitCast(u64, info.StandardInformation.EndOfFile),
.mode = 0,
- .kind = if (info.StandardInformation.Directory == 0) .File else .Directory,
+ .kind = if (info.StandardInformation.Directory == 0) .file else .directory,
.atime = windows.fromSysTime(info.BasicInformation.LastAccessTime),
.mtime = windows.fromSysTime(info.BasicInformation.LastWriteTime),
.ctime = windows.fromSysTime(info.BasicInformation.CreationTime),
@@ -609,7 +609,7 @@ pub const File = struct {
}
/// Returns the `Kind` of file.
- /// On Windows, can only return: `.File`, `.Directory`, `.SymLink` or `.Unknown`
+ /// On Windows, can only return: `.file`, `.directory`, `.sym_link` or `.unknown`
pub fn kind(self: Self) Kind {
return self.inner.kind();
}
@@ -652,35 +652,35 @@ pub const File = struct {
/// Returns the `Kind` of the file
pub fn kind(self: Self) Kind {
if (builtin.os.tag == .wasi and !builtin.link_libc) return switch (self.stat.filetype) {
- .BLOCK_DEVICE => Kind.BlockDevice,
- .CHARACTER_DEVICE => Kind.CharacterDevice,
- .DIRECTORY => Kind.Directory,
- .SYMBOLIC_LINK => Kind.SymLink,
- .REGULAR_FILE => Kind.File,
- .SOCKET_STREAM, .SOCKET_DGRAM => Kind.UnixDomainSocket,
- else => Kind.Unknown,
+ .BLOCK_DEVICE => .block_device,
+ .CHARACTER_DEVICE => .character_device,
+ .DIRECTORY => .directory,
+ .SYMBOLIC_LINK => .sym_link,
+ .REGULAR_FILE => .file,
+ .SOCKET_STREAM, .SOCKET_DGRAM => .unix_domain_socket,
+ else => .unknown,
};
const m = self.stat.mode & os.S.IFMT;
switch (m) {
- os.S.IFBLK => return Kind.BlockDevice,
- os.S.IFCHR => return Kind.CharacterDevice,
- os.S.IFDIR => return Kind.Directory,
- os.S.IFIFO => return Kind.NamedPipe,
- os.S.IFLNK => return Kind.SymLink,
- os.S.IFREG => return Kind.File,
- os.S.IFSOCK => return Kind.UnixDomainSocket,
+ os.S.IFBLK => return .block_device,
+ os.S.IFCHR => return .character_device,
+ os.S.IFDIR => return .directory,
+ os.S.IFIFO => return .named_pipe,
+ os.S.IFLNK => return .sym_link,
+ os.S.IFREG => return .file,
+ os.S.IFSOCK => return .unix_domain_socket,
else => {},
}
if (builtin.os.tag == .solaris) switch (m) {
- os.S.IFDOOR => return Kind.Door,
- os.S.IFPORT => return Kind.EventPort,
+ os.S.IFDOOR => return .door,
+ os.S.IFPORT => return .event_port,
else => {},
};
- return .Unknown;
+ return .unknown;
}
/// Returns the last time the file was accessed in nanoseconds since UTC 1970-01-01
@@ -738,17 +738,17 @@ pub const File = struct {
const m = self.statx.mode & os.S.IFMT;
switch (m) {
- os.S.IFBLK => return Kind.BlockDevice,
- os.S.IFCHR => return Kind.CharacterDevice,
- os.S.IFDIR => return Kind.Directory,
- os.S.IFIFO => return Kind.NamedPipe,
- os.S.IFLNK => return Kind.SymLink,
- os.S.IFREG => return Kind.File,
- os.S.IFSOCK => return Kind.UnixDomainSocket,
+ os.S.IFBLK => return .block_device,
+ os.S.IFCHR => return .character_device,
+ os.S.IFDIR => return .directory,
+ os.S.IFIFO => return .named_pipe,
+ os.S.IFLNK => return .sym_link,
+ os.S.IFREG => return .file,
+ os.S.IFSOCK => return .unix_domain_socket,
else => {},
}
- return .Unknown;
+ return .unknown;
}
/// Returns the last time the file was accessed in nanoseconds since UTC 1970-01-01
@@ -790,18 +790,18 @@ pub const File = struct {
}
/// Returns the `Kind` of the file.
- /// Can only return: `.File`, `.Directory`, `.SymLink` or `.Unknown`
+ /// Can only return: `.file`, `.directory`, `.sym_link` or `.unknown`
pub fn kind(self: Self) Kind {
if (self.attributes & windows.FILE_ATTRIBUTE_REPARSE_POINT != 0) {
if (self.reparse_tag & 0x20000000 != 0) {
- return .SymLink;
+ return .sym_link;
}
} else if (self.attributes & windows.FILE_ATTRIBUTE_DIRECTORY != 0) {
- return .Directory;
+ return .directory;
} else {
- return .File;
+ return .file;
}
- return .Unknown;
+ return .unknown;
}
/// Returns the last time the file was accessed in nanoseconds since UTC 1970-01-01
lib/std/fs/test.zig
@@ -179,8 +179,8 @@ test "Dir.Iterator" {
}
try testing.expect(entries.items.len == 2); // note that the Iterator skips '.' and '..'
- try testing.expect(contains(&entries, .{ .name = "some_file", .kind = .File }));
- try testing.expect(contains(&entries, .{ .name = "some_dir", .kind = .Directory }));
+ try testing.expect(contains(&entries, .{ .name = "some_file", .kind = .file }));
+ try testing.expect(contains(&entries, .{ .name = "some_dir", .kind = .directory }));
}
test "Dir.Iterator many entries" {
@@ -214,7 +214,7 @@ test "Dir.Iterator many entries" {
i = 0;
while (i < num) : (i += 1) {
const name = try std.fmt.bufPrint(&buf, "{}", .{i});
- try testing.expect(contains(&entries, .{ .name = name, .kind = .File }));
+ try testing.expect(contains(&entries, .{ .name = name, .kind = .file }));
}
}
@@ -246,8 +246,8 @@ test "Dir.Iterator twice" {
}
try testing.expect(entries.items.len == 2); // note that the Iterator skips '.' and '..'
- try testing.expect(contains(&entries, .{ .name = "some_file", .kind = .File }));
- try testing.expect(contains(&entries, .{ .name = "some_dir", .kind = .Directory }));
+ try testing.expect(contains(&entries, .{ .name = "some_file", .kind = .file }));
+ try testing.expect(contains(&entries, .{ .name = "some_dir", .kind = .directory }));
}
}
@@ -280,8 +280,8 @@ test "Dir.Iterator reset" {
}
try testing.expect(entries.items.len == 2); // note that the Iterator skips '.' and '..'
- try testing.expect(contains(&entries, .{ .name = "some_file", .kind = .File }));
- try testing.expect(contains(&entries, .{ .name = "some_dir", .kind = .Directory }));
+ try testing.expect(contains(&entries, .{ .name = "some_file", .kind = .file }));
+ try testing.expect(contains(&entries, .{ .name = "some_dir", .kind = .directory }));
iter.reset();
}
@@ -428,7 +428,7 @@ test "directory operations on files" {
// ensure the file still exists and is a file as a sanity check
file = try tmp_dir.dir.openFile(test_file_name, .{});
const stat = try file.stat();
- try testing.expect(stat.kind == .File);
+ try testing.expect(stat.kind == .file);
file.close();
}
@@ -664,7 +664,7 @@ test "renameAbsolute" {
try testing.expectError(error.FileNotFound, tmp_dir.dir.openFile(test_file_name, .{}));
file = try tmp_dir.dir.openFile(renamed_test_file_name, .{});
const stat = try file.stat();
- try testing.expect(stat.kind == .File);
+ try testing.expect(stat.kind == .file);
file.close();
// Renaming directories
@@ -1348,7 +1348,7 @@ test "File.Metadata" {
defer file.close();
const metadata = try file.metadata();
- try testing.expect(metadata.kind() == .File);
+ try testing.expect(metadata.kind() == .file);
try testing.expect(metadata.size() == 0);
_ = metadata.accessed();
_ = metadata.modified();
lib/std/fs.zig
@@ -385,16 +385,16 @@ pub const IterableDir = struct {
continue :start_over;
}
- const entry_kind = switch (darwin_entry.d_type) {
- os.DT.BLK => Entry.Kind.BlockDevice,
- os.DT.CHR => Entry.Kind.CharacterDevice,
- os.DT.DIR => Entry.Kind.Directory,
- os.DT.FIFO => Entry.Kind.NamedPipe,
- os.DT.LNK => Entry.Kind.SymLink,
- os.DT.REG => Entry.Kind.File,
- os.DT.SOCK => Entry.Kind.UnixDomainSocket,
- os.DT.WHT => Entry.Kind.Whiteout,
- else => Entry.Kind.Unknown,
+ const entry_kind: Entry.Kind = switch (darwin_entry.d_type) {
+ os.DT.BLK => .block_device,
+ os.DT.CHR => .character_device,
+ os.DT.DIR => .directory,
+ os.DT.FIFO => .named_pipe,
+ os.DT.LNK => .sym_link,
+ os.DT.REG => .file,
+ os.DT.SOCK => .unix_domain_socket,
+ os.DT.WHT => .whiteout,
+ else => .unknown,
};
return Entry{
.name = name,
@@ -442,17 +442,17 @@ pub const IterableDir = struct {
error.FileNotFound => unreachable, // lost the race
else => |e| return e,
};
- const entry_kind = switch (stat_info.mode & os.S.IFMT) {
- os.S.IFIFO => Entry.Kind.NamedPipe,
- os.S.IFCHR => Entry.Kind.CharacterDevice,
- os.S.IFDIR => Entry.Kind.Directory,
- os.S.IFBLK => Entry.Kind.BlockDevice,
- os.S.IFREG => Entry.Kind.File,
- os.S.IFLNK => Entry.Kind.SymLink,
- os.S.IFSOCK => Entry.Kind.UnixDomainSocket,
- os.S.IFDOOR => Entry.Kind.Door,
- os.S.IFPORT => Entry.Kind.EventPort,
- else => Entry.Kind.Unknown,
+ const entry_kind: Entry.Kind = switch (stat_info.mode & os.S.IFMT) {
+ os.S.IFIFO => .named_pipe,
+ os.S.IFCHR => .character_device,
+ os.S.IFDIR => .directory,
+ os.S.IFBLK => .block_device,
+ os.S.IFREG => .file,
+ os.S.IFLNK => .sym_link,
+ os.S.IFSOCK => .unix_domain_socket,
+ os.S.IFDOOR => .door,
+ os.S.IFPORT => .event_port,
+ else => .unknown,
};
return Entry{
.name = name,
@@ -501,16 +501,16 @@ pub const IterableDir = struct {
continue :start_over;
}
- const entry_kind = switch (bsd_entry.d_type) {
- os.DT.BLK => Entry.Kind.BlockDevice,
- os.DT.CHR => Entry.Kind.CharacterDevice,
- os.DT.DIR => Entry.Kind.Directory,
- os.DT.FIFO => Entry.Kind.NamedPipe,
- os.DT.LNK => Entry.Kind.SymLink,
- os.DT.REG => Entry.Kind.File,
- os.DT.SOCK => Entry.Kind.UnixDomainSocket,
- os.DT.WHT => Entry.Kind.Whiteout,
- else => Entry.Kind.Unknown,
+ const entry_kind: Entry.Kind = switch (bsd_entry.d_type) {
+ os.DT.BLK => .block_device,
+ os.DT.CHR => .character_device,
+ os.DT.DIR => .directory,
+ os.DT.FIFO => .named_pipe,
+ os.DT.LNK => .sym_link,
+ os.DT.REG => .file,
+ os.DT.SOCK => .unix_domain_socket,
+ os.DT.WHT => .whiteout,
+ else => .unknown,
};
return Entry{
.name = name,
@@ -595,14 +595,14 @@ pub const IterableDir = struct {
}
const statmode = stat_info.mode & os.S.IFMT;
- const entry_kind = switch (statmode) {
- os.S.IFDIR => Entry.Kind.Directory,
- os.S.IFBLK => Entry.Kind.BlockDevice,
- os.S.IFCHR => Entry.Kind.CharacterDevice,
- os.S.IFLNK => Entry.Kind.SymLink,
- os.S.IFREG => Entry.Kind.File,
- os.S.IFIFO => Entry.Kind.NamedPipe,
- else => Entry.Kind.Unknown,
+ const entry_kind: Entry.Kind = switch (statmode) {
+ os.S.IFDIR => .directory,
+ os.S.IFBLK => .block_device,
+ os.S.IFCHR => .character_device,
+ os.S.IFLNK => .sym_link,
+ os.S.IFREG => .file,
+ os.S.IFIFO => .named_pipe,
+ else => .unknown,
};
return Entry{
@@ -679,15 +679,15 @@ pub const IterableDir = struct {
continue :start_over;
}
- const entry_kind = switch (linux_entry.d_type) {
- linux.DT.BLK => Entry.Kind.BlockDevice,
- linux.DT.CHR => Entry.Kind.CharacterDevice,
- linux.DT.DIR => Entry.Kind.Directory,
- linux.DT.FIFO => Entry.Kind.NamedPipe,
- linux.DT.LNK => Entry.Kind.SymLink,
- linux.DT.REG => Entry.Kind.File,
- linux.DT.SOCK => Entry.Kind.UnixDomainSocket,
- else => Entry.Kind.Unknown,
+ const entry_kind: Entry.Kind = switch (linux_entry.d_type) {
+ linux.DT.BLK => .block_device,
+ linux.DT.CHR => .character_device,
+ linux.DT.DIR => .directory,
+ linux.DT.FIFO => .named_pipe,
+ linux.DT.LNK => .sym_link,
+ linux.DT.REG => .file,
+ linux.DT.SOCK => .unix_domain_socket,
+ else => .unknown,
};
return Entry{
.name = name,
@@ -761,11 +761,11 @@ pub const IterableDir = struct {
// Trust that Windows gives us valid UTF-16LE
const name_utf8_len = std.unicode.utf16leToUtf8(self.name_data[0..], name_utf16le) catch unreachable;
const name_utf8 = self.name_data[0..name_utf8_len];
- const kind = blk: {
+ const kind: Entry.Kind = blk: {
const attrs = dir_info.FileAttributes;
- if (attrs & w.FILE_ATTRIBUTE_DIRECTORY != 0) break :blk Entry.Kind.Directory;
- if (attrs & w.FILE_ATTRIBUTE_REPARSE_POINT != 0) break :blk Entry.Kind.SymLink;
- break :blk Entry.Kind.File;
+ if (attrs & w.FILE_ATTRIBUTE_DIRECTORY != 0) break :blk .directory;
+ if (attrs & w.FILE_ATTRIBUTE_REPARSE_POINT != 0) break :blk .sym_link;
+ break :blk .file;
};
return Entry{
.name = name_utf8,
@@ -850,14 +850,14 @@ pub const IterableDir = struct {
continue :start_over;
}
- const entry_kind = switch (entry.d_type) {
- .BLOCK_DEVICE => Entry.Kind.BlockDevice,
- .CHARACTER_DEVICE => Entry.Kind.CharacterDevice,
- .DIRECTORY => Entry.Kind.Directory,
- .SYMBOLIC_LINK => Entry.Kind.SymLink,
- .REGULAR_FILE => Entry.Kind.File,
- .SOCKET_STREAM, .SOCKET_DGRAM => Entry.Kind.UnixDomainSocket,
- else => Entry.Kind.Unknown,
+ const entry_kind: Entry.Kind = switch (entry.d_type) {
+ .BLOCK_DEVICE => .block_device,
+ .CHARACTER_DEVICE => .character_device,
+ .DIRECTORY => .directory,
+ .SYMBOLIC_LINK => .sym_link,
+ .REGULAR_FILE => .file,
+ .SOCKET_STREAM, .SOCKET_DGRAM => .unix_domain_socket,
+ else => .unknown,
};
return Entry{
.name = name,
@@ -964,7 +964,7 @@ pub const IterableDir = struct {
dirname_len += 1;
}
try self.name_buffer.appendSlice(base.name);
- if (base.kind == .Directory) {
+ if (base.kind == .directory) {
var new_dir = top.iter.dir.openIterableDir(base.name, .{}) catch |err| switch (err) {
error.NameTooLong => unreachable, // no path sep in base.name
else => |e| return e,
@@ -2106,7 +2106,7 @@ pub const Dir = struct {
/// this function recursively removes its entries and then tries again.
/// This operation is not atomic on most file systems.
pub fn deleteTree(self: Dir, sub_path: []const u8) DeleteTreeError!void {
- var initial_iterable_dir = (try self.deleteTreeOpenInitialSubpath(sub_path, .File)) orelse return;
+ var initial_iterable_dir = (try self.deleteTreeOpenInitialSubpath(sub_path, .file)) orelse return;
const StackItem = struct {
name: []const u8,
@@ -2130,7 +2130,7 @@ pub const Dir = struct {
process_stack: while (stack.len != 0) {
var top = &(stack.slice()[stack.len - 1]);
while (try top.iter.next()) |entry| {
- var treat_as_dir = entry.kind == .Directory;
+ var treat_as_dir = entry.kind == .directory;
handle_entry: while (true) {
if (treat_as_dir) {
if (stack.ensureUnusedCapacity(1)) {
@@ -2291,7 +2291,7 @@ pub const Dir = struct {
/// Like `deleteTree`, but only keeps one `Iterator` active at a time to minimize the function's stack size.
/// This is slower than `deleteTree` but uses less stack space.
pub fn deleteTreeMinStackSize(self: Dir, sub_path: []const u8) DeleteTreeError!void {
- return self.deleteTreeMinStackSizeWithKindHint(sub_path, .File);
+ return self.deleteTreeMinStackSizeWithKindHint(sub_path, .file);
}
fn deleteTreeMinStackSizeWithKindHint(self: Dir, sub_path: []const u8, kind_hint: File.Kind) DeleteTreeError!void {
@@ -2316,7 +2316,7 @@ pub const Dir = struct {
scan_dir: while (true) {
var dir_it = iterable_dir.iterateAssumeFirstIteration();
dir_it: while (try dir_it.next()) |entry| {
- var treat_as_dir = entry.kind == .Directory;
+ var treat_as_dir = entry.kind == .directory;
handle_entry: while (true) {
if (treat_as_dir) {
const new_dir = iterable_dir.dir.openIterableDir(entry.name, .{ .no_follow = true }) catch |err| switch (err) {
@@ -2407,7 +2407,7 @@ pub const Dir = struct {
fn deleteTreeOpenInitialSubpath(self: Dir, sub_path: []const u8, kind_hint: File.Kind) !?IterableDir {
return iterable_dir: {
// Treat as a file by default
- var treat_as_dir = kind_hint == .Directory;
+ var treat_as_dir = kind_hint == .directory;
handle_entry: while (true) {
if (treat_as_dir) {
src/main.zig
@@ -4830,11 +4830,11 @@ fn fmtPathDir(
var dir_it = iterable_dir.iterate();
while (try dir_it.next()) |entry| {
- const is_dir = entry.kind == .Directory;
+ const is_dir = entry.kind == .directory;
if (is_dir and (mem.eql(u8, entry.name, "zig-cache") or mem.eql(u8, entry.name, "zig-out"))) continue;
- if (is_dir or entry.kind == .File and (mem.endsWith(u8, entry.name, ".zig") or mem.endsWith(u8, entry.name, ".zon"))) {
+ if (is_dir or entry.kind == .file and (mem.endsWith(u8, entry.name, ".zig") or mem.endsWith(u8, entry.name, ".zon"))) {
const full_path = try fs.path.join(fmt.gpa, &[_][]const u8{ file_path, entry.name });
defer fmt.gpa.free(full_path);
@@ -4864,7 +4864,7 @@ fn fmtPathFile(
const stat = try source_file.stat();
- if (stat.kind == .Directory)
+ if (stat.kind == .directory)
return error.IsDir;
const gpa = fmt.gpa;
src/Package.zig
@@ -651,8 +651,8 @@ fn computePackageHash(
while (try walker.next()) |entry| {
switch (entry.kind) {
- .Directory => continue,
- .File => {},
+ .directory => continue,
+ .file => {},
else => return error.IllegalFileTypeInPackage,
}
const hashed_file = try arena.create(HashedFile);
test/src/Cases.zig
@@ -349,7 +349,7 @@ fn addFromDirInner(
var filenames = std.ArrayList([]const u8).init(ctx.arena);
while (try it.next()) |entry| {
- if (entry.kind != .File) continue;
+ if (entry.kind != .file) continue;
// Ignore stuff such as .swp files
switch (Compilation.classifyFileExt(entry.basename)) {
@@ -1039,7 +1039,7 @@ pub fn main() !void {
const stem = case_file_path[case_dirname.len + 1 .. case_file_path.len - "0.zig".len];
var it = iterable_dir.iterate();
while (try it.next()) |entry| {
- if (entry.kind != .File) continue;
+ if (entry.kind != .file) continue;
if (!std.mem.startsWith(u8, entry.name, stem)) continue;
try filenames.append(try std.fs.path.join(arena, &.{ case_dirname, entry.name }));
}
tools/process_headers.zig
@@ -393,8 +393,8 @@ pub fn main() !void {
while (try dir_it.next()) |entry| {
const full_path = try std.fs.path.join(allocator, &[_][]const u8{ full_dir_name, entry.name });
switch (entry.kind) {
- .Directory => try dir_stack.append(full_path),
- .File => {
+ .directory => try dir_stack.append(full_path),
+ .file => {
const rel_path = try std.fs.path.relative(allocator, target_include_dir, full_path);
const max_size = 2 * 1024 * 1024 * 1024;
const raw_bytes = try std.fs.cwd().readFileAlloc(allocator, full_path, max_size);
tools/update-linux-headers.zig
@@ -193,8 +193,8 @@ pub fn main() !void {
while (try dir_it.next()) |entry| {
const full_path = try std.fs.path.join(arena, &[_][]const u8{ full_dir_name, entry.name });
switch (entry.kind) {
- .Directory => try dir_stack.append(full_path),
- .File => {
+ .directory => try dir_stack.append(full_path),
+ .file => {
const rel_path = try std.fs.path.relative(arena, target_include_dir, full_path);
const max_size = 2 * 1024 * 1024 * 1024;
const raw_bytes = try std.fs.cwd().readFileAlloc(arena, full_path, max_size);
tools/update_glibc.zig
@@ -57,7 +57,7 @@ pub fn main() !void {
defer walker.deinit();
walk: while (try walker.next()) |entry| {
- if (entry.kind != .File) continue;
+ if (entry.kind != .file) continue;
if (mem.startsWith(u8, entry.basename, ".")) continue;
for (exempt_files) |p| {
if (mem.eql(u8, entry.path, p)) continue :walk;
@@ -98,7 +98,7 @@ pub fn main() !void {
defer walker.deinit();
walk: while (try walker.next()) |entry| {
- if (entry.kind != .File) continue;
+ if (entry.kind != .file) continue;
if (mem.startsWith(u8, entry.basename, ".")) continue;
for (exempt_files) |p| {
if (mem.eql(u8, entry.path, p)) continue :walk;
tools/update_spirv_features.zig
@@ -227,7 +227,7 @@ fn gather_extensions(allocator: Allocator, spirv_registry_root: []const u8) ![]c
var vendor_it = extensions_dir.iterate();
while (try vendor_it.next()) |vendor_entry| {
- std.debug.assert(vendor_entry.kind == .Directory); // If this fails, the structure of SPIRV-Registry has changed.
+ std.debug.assert(vendor_entry.kind == .directory); // If this fails, the structure of SPIRV-Registry has changed.
const vendor_dir = try extensions_dir.dir.openIterableDir(vendor_entry.name, .{});
var ext_it = vendor_dir.iterate();