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/Threaded.zig | |
| parent | 314c906dba32e72317947a15254519b22745b13f (diff) | |
| download | zig-950d18ef695bb7a28397e080dc3c201559ec4ee2.tar.gz zig-950d18ef695bb7a28397e080dc3c201559ec4ee2.zip | |
update all access() to access(io)
Diffstat (limited to 'lib/std/Io/Threaded.zig')
| -rw-r--r-- | lib/std/Io/Threaded.zig | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/std/Io/Threaded.zig b/lib/std/Io/Threaded.zig index 4ee1d5db53..16e8930267 100644 --- a/lib/std/Io/Threaded.zig +++ b/lib/std/Io/Threaded.zig @@ -12,7 +12,7 @@ const std = @import("../std.zig"); const Io = std.Io; const net = std.Io.net; const File = std.Io.File; -const Dir = std.Dir; +const Dir = std.Io.Dir; const HostName = std.Io.net.HostName; const IpAddress = std.Io.net.IpAddress; const Allocator = std.mem.Allocator; @@ -1614,13 +1614,14 @@ fn dirMakeOpenPathPosix( userdata: ?*anyopaque, dir: Dir, sub_path: []const u8, + permissions: Dir.Permissions, options: Dir.OpenOptions, ) Dir.MakeOpenPathError!Dir { const t: *Threaded = @ptrCast(@alignCast(userdata)); const t_io = ioBasic(t); - return dirOpenDirPosix(t, dir, sub_path, options) catch |err| switch (err) { + return dirOpenDirPosix(t, dir, sub_path, permissions, options) catch |err| switch (err) { error.FileNotFound => { - try dir.makePath(t_io, sub_path); + _ = try dir.makePathStatus(t_io, sub_path, permissions); return dirOpenDirPosix(t, dir, sub_path, options); }, else => |e| return e, @@ -1631,12 +1632,15 @@ fn dirMakeOpenPathWindows( userdata: ?*anyopaque, dir: Dir, sub_path: []const u8, + permissions: Dir.Permissions, options: Dir.OpenOptions, ) Dir.MakeOpenPathError!Dir { const t: *Threaded = @ptrCast(@alignCast(userdata)); const current_thread = Thread.getCurrent(t); const w = windows; + _ = permissions; // TODO apply these permissions + var it = std.fs.path.componentIterator(sub_path); // If there are no components in the path, then create a dummy component with the full path. var component: std.fs.path.NativeComponentIterator.Component = it.last() orelse .{ @@ -1746,13 +1750,14 @@ fn dirMakeOpenPathWasi( userdata: ?*anyopaque, dir: Dir, sub_path: []const u8, + permissions: Dir.Permissions, options: Dir.OpenOptions, ) Dir.MakeOpenPathError!Dir { const t: *Threaded = @ptrCast(@alignCast(userdata)); const t_io = ioBasic(t); return dirOpenDirWasi(t, dir, sub_path, options) catch |err| switch (err) { error.FileNotFound => { - try dir.makePath(t_io, sub_path); + _ = try dir.makePathStatus(t_io, sub_path, permissions); return dirOpenDirWasi(t, dir, sub_path, options); }, else => |e| return e, |
