diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-12-08 17:14:31 -0800 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-12-23 22:15:08 -0800 |
| commit | 950d18ef695bb7a28397e080dc3c201559ec4ee2 (patch) | |
| tree | 253209139275932ed503a5ea4529594ab70df8cc /lib/std/Io/Dir.zig | |
| parent | 314c906dba32e72317947a15254519b22745b13f (diff) | |
| download | zig-950d18ef695bb7a28397e080dc3c201559ec4ee2.tar.gz zig-950d18ef695bb7a28397e080dc3c201559ec4ee2.zip | |
update all access() to access(io)
Diffstat (limited to 'lib/std/Io/Dir.zig')
| -rw-r--r-- | lib/std/Io/Dir.zig | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/std/Io/Dir.zig b/lib/std/Io/Dir.zig index 58f81cbb90..755ce924ad 100644 --- a/lib/std/Io/Dir.zig +++ b/lib/std/Io/Dir.zig @@ -191,7 +191,7 @@ pub const SelectiveWalker = struct { while (self.stack.items.len > 0) { const top = &self.stack.items[self.stack.items.len - 1]; var dirname_len = top.dirname_len; - if (top.iter.next() catch |err| { + if (top.iter.next(io) catch |err| { // If we get an error, then we want the user to be able to continue // walking if they want, which means that we need to pop the directory // that errored from the stack. Otherwise, all future `next` calls would @@ -302,7 +302,7 @@ pub const Walker = struct { dir: Dir, basename: [:0]const u8, path: [:0]const u8, - kind: Dir.Entry.Kind, + kind: File.Kind, /// Returns the depth of the entry relative to the initial directory. /// Returns 1 for a direct child of the initial directory, 2 for an entry @@ -320,10 +320,10 @@ pub const Walker = struct { /// After each call to this function, and on deinit(), the memory returned /// from this function becomes invalid. A copy must be made in order to keep /// a reference to the path. - pub fn next(self: *Walker) !?Walker.Entry { - const entry = try self.inner.next(); + pub fn next(self: *Walker, io: Io) !?Walker.Entry { + const entry = try self.inner.next(io); if (entry != null and entry.?.kind == .directory) { - try self.inner.enter(entry.?); + try self.inner.enter(io, entry.?); } return entry; } @@ -495,7 +495,7 @@ pub const WriteFileOptions = struct { flags: File.CreateFlags = .{}, }; -pub const WriteFileError = File.WriteError || File.OpenError; +pub const WriteFileError = File.Writer.Error || File.OpenError; /// Writes content to the file system, using the file creation flags provided. pub fn writeFile(dir: Dir, io: Io, options: WriteFileOptions) WriteFileError!void { @@ -556,11 +556,11 @@ pub fn updateFile( } if (path.dirname(dest_path)) |dirname| { - try dest_dir.makePath(io, dirname, .default_dir); + try dest_dir.makePath(io, dirname); } var buffer: [1000]u8 = undefined; // Used only when direct fd-to-fd is not available. - var atomic_file = try Dir.atomicFile(dest_dir, dest_path, .{ + var atomic_file = try dest_dir.atomicFile(io, dest_path, .{ .permissions = actual_permissions, .write_buffer = &buffer, }); |
