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/main.zig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main.zig') diff --git a/src/main.zig b/src/main.zig index 623b6033..68542b3e 100644 --- a/src/main.zig +++ b/src/main.zig @@ -639,9 +639,9 @@ fn nativeMain(std_init: std.process.Init) !void { // A name not there yet, as acme's B takes one: its directory // resolved and the name kept, a pane made for it that Save // creates the file from. - const base = std.fs.path.basename(target.path); + const base = std.Io.Dir.path.basename(target.path); if (base.len == 0 or std.mem.eql(u8, base, ".") or std.mem.eql(u8, base, "..")) Refuse.with(init.io, word, error.NotAFileName); - const dir = pardes.filesystem.resolveOs(std.fs.path.dirname(target.path) orelse ".", &realbuf) orelse { + const dir = pardes.filesystem.resolveOs(std.Io.Dir.path.dirname(target.path) orelse ".", &realbuf) orelse { // Its directory not there either: the name made absolute as // written, and the pane's Save makes the directories. var cwd_buf: [4096]u8 = undefined; @@ -650,7 +650,7 @@ fn nativeMain(std_init: std.process.Init) !void { const absolute = std.fs.path.resolvePosix(arena, &.{ cwd, target.path }) catch |err| Refuse.with(init.io, word, err); // Missing because one above may not be searched or written: // its Save could never make it, so refused now. - if (pardes.filesystem.deniedAbove(std.fs.path.dirname(absolute) orelse "/")) Refuse.with(init.io, word, error.DirectoryNotWritable); + if (pardes.filesystem.deniedAbove(std.Io.Dir.path.dirname(absolute) orelse "/")) Refuse.with(init.io, word, error.DirectoryNotWritable); break :named absolute; }; // A directory that is there but may not be read or written: a @@ -1111,9 +1111,9 @@ test { /// $XDG_STATE_HOME/pardes, else ~/.local/state/pardes. A state file that /// holds no Recent yet reads them once (Db.zig). fn oldRecentDir(arena: std.mem.Allocator, env: *const std.process.Environ.Map) ?[]const u8 { - if (env.get("XDG_STATE_HOME")) |base| if (base.len != 0 and std.fs.path.isAbsolute(base)) - return std.fs.path.join(arena, &.{ base, "pardes" }) catch null; + if (env.get("XDG_STATE_HOME")) |base| if (base.len != 0 and std.Io.Dir.path.isAbsolute(base)) + return std.Io.Dir.path.join(arena, &.{ base, "pardes" }) catch null; const home = env.get("HOME") orelse return null; if (home.len == 0) return null; - return std.fs.path.join(arena, &.{ home, ".local", "state", "pardes" }) catch null; + return std.Io.Dir.path.join(arena, &.{ home, ".local", "state", "pardes" }) catch null; } -- cgit v1.3