summaryrefslogtreecommitdiff
path: root/src/file_watch.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 13:36:33 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commitfea3f2c5abf14aada5d9187b82985e51eb5b7a98 (patch)
tree6dd3c54c8aaa1ad5941a74200b18da12e512b7fb /src/file_watch.zig
parentbe5f559939fc11cbfba95b4a7d518816bec8677a (diff)
downloadpardes-fea3f2c5abf14aada5d9187b82985e51eb5b7a98.tar.gz
pardes-fea3f2c5abf14aada5d9187b82985e51eb5b7a98.zip
A path with a part over 255 bytes is refused, never a panic
std's statFile takes the kernel's ENAMETOOLONG for a bug (errnoBug), so a name, look, DumpDir or Save path with a part over 255 bytes panicked the editor (exec.kindOf via writeName, recentKeeps, dumpFailed). Every non-test statFile now goes through fs.statPath, which refuses such a name as NameTooLong first; fs.py drives long, looping, not-a-directory and not-ours paths through name, look, DumpDir, Dump and Save. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/file_watch.zig')
-rw-r--r--src/file_watch.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/file_watch.zig b/src/file_watch.zig
index 8bd9de8b..81f4ba87 100644
--- a/src/file_watch.zig
+++ b/src/file_watch.zig
@@ -397,7 +397,7 @@ fn watchPath(
// stat and a lookup out there: the turn goes out with them.
pardes.turn.yield();
defer pardes.turn.back();
- const stat = std.Io.Dir.cwd().statFile(std.Io.Threaded.global_single_threaded.io(), watched_path, .{}) catch null;
+ const stat = @import("fs.zig").statPath(std.Io.Threaded.global_single_threaded.io(), watched_path, .{}) catch null;
const dir = if (stat != null and stat.?.kind == .directory) watched_path else std.fs.path.dirname(watched_path) orelse ".";
var dir_buf: [4096:0]u8 = undefined;
if (dir.len >= dir_buf.len) return;
@@ -631,7 +631,7 @@ pub fn identify(io: std.Io, path: []const u8) !Identity {
const native = filesystem.localPath(path) orelse return error.NonLocalPath;
pardes.turn.yield();
defer pardes.turn.back();
- const stat = try std.Io.Dir.cwd().statFile(io, native, .{});
+ const stat = try @import("fs.zig").statPath(io, native, .{});
if (stat.kind != .file) return error.NotFile;
return .{
.inode = stat.inode,