From 77671575bd2f481651ea54e956ac5c7da8d63710 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 6 Nov 2026 12:14:58 -0300 Subject: idioms #1, std.fs's deprecated aliases in the hosts: std.fs.path and std.fs.max_path_bytes are std.Io.Dir.path and std.Io.Dir.max_path_bytes in 0.17, so the hosts name them there Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/fs.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/fs.zig') diff --git a/src/fs.zig b/src/fs.zig index b5ee2d9e..e3976884 100644 --- a/src/fs.zig +++ b/src/fs.zig @@ -167,7 +167,7 @@ pub fn osHandle(p: *pardes.Pardes, req: Req) Reply { if (req.op == .release) return .{ .tag = req.tag }; const io = std.Io.Threaded.global_single_threaded.io(); const stat = pardes.tape.site(.os_stat, null, osStat, .{ io, path }) catch return Reply.fail(req.tag, E.NOENT); - const attr: Reply.Attr = .{ .name = if (req.node == os_root) "os" else std.fs.path.basename(path), .node = req.node, .dir = stat.kind == .directory, .size = stat.size, .mode = if (stat.kind == .directory) 0o755 else 0o644, .mtime = stat.mtime }; + const attr: Reply.Attr = .{ .name = if (req.node == os_root) "os" else std.Io.Dir.path.basename(path), .node = req.node, .dir = stat.kind == .directory, .size = stat.size, .mode = if (stat.kind == .directory) 0o755 else 0o644, .mtime = stat.mtime }; switch (req.op) { .getattr => return .{ .tag = req.tag, .attr = attr }, .open => { @@ -710,7 +710,7 @@ fn makeDirsHost(dir: []const u8) void { pub fn deniedAbove(dir: []const u8) bool { if (comptime !platform_has_fs) return false; var at: ?[]const u8 = dir; - while (at) |d| : (at = std.fs.path.dirname(d)) { + while (at) |d| : (at = std.Io.Dir.path.dirname(d)) { var z: [4096]u8 = undefined; const dz = std.fmt.bufPrintSentinel(&z, "{s}", .{d}, 0) catch return false; if (libc.access(dz.ptr, 0) != 0) continue; // F_OK @@ -1120,7 +1120,7 @@ pub fn readRestore(gpa: std.mem.Allocator, typed: []const u8, dir_setting: []con pub fn restorePath(typed: []const u8, dir_setting: []const u8, out: *[4096]u8) []const u8 { var home_buf: [4096]u8 = undefined; const path = expandHome(typed, &home_buf); - if (!std.fs.path.isAbsolute(path)) { + if (!std.Io.Dir.path.isAbsolute(path)) { var dir_buf: [4096]u8 = undefined; if (@import("dump.zig").directory(&dir_buf, dir_setting)) |base| { var buf: [4096]u8 = undefined; -- cgit v1.3