summaryrefslogtreecommitdiff
path: root/src/fs.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-06 12:14:58 -0300
committerGabriel Schneider <[email protected]>2026-11-06 14:56:36 -0300
commit77671575bd2f481651ea54e956ac5c7da8d63710 (patch)
treedef07749c63bdc279e0119d58101aa1399dd5cf3 /src/fs.zig
parentb5bb5e8ccf71a5755dde95f04440ee9c6aaa18da (diff)
downloadpardes-77671575bd2f481651ea54e956ac5c7da8d63710.tar.gz
pardes-77671575bd2f481651ea54e956ac5c7da8d63710.zip
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 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/fs.zig')
-rw-r--r--src/fs.zig6
1 files changed, 3 insertions, 3 deletions
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;