From 4d57197f0135c292750731dd19a6df542378135d Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 10:16:45 -0300 Subject: A look at a path not there under a peer's mount is a miss, the write answered, as any path to no file is It failed the write with the peer's "file does not exist". A file not found, here or through a mount, is now said and logged as a miss. Co-Authored-By: Claude Opus 5.5 --- src/look.zig | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/look.zig b/src/look.zig index 19b320f9..115dabe1 100644 --- a/src/look.zig +++ b/src/look.zig @@ -1251,6 +1251,11 @@ test "a miss names a long path by its start and its end, its middle given up to fn lookOpenFailed(p: *Pardes, id: usize, path: []const u8, err: anyerror) void { if (@import("Messages.zig").dialReason(err) != null) return p.reportError(id, path, err); var cut: [miss_path_cap + "…".len]u8 = undefined; + // Not there, on a peer's mount as on this host: a miss, the write + // answered, as any path to no file is. + const remote_missing = if (comptime pardes.hosted) err == error.Remote and std.mem.indexOf(u8, @import("9p_io.zig").Client.lastSaid(), "not exist") != null else false; + if (err == error.FileNotFound or err == error.NotFound or remote_missing) + return missed(p, id, "{s}: no such file", .{missText(path, &cut)}); var said: [miss_path_cap + 16]u8 = undefined; p.reportError(id, std.fmt.bufPrint(&said, "look: {s}", .{missText(path, &cut)}) catch "look", err); } -- cgit v1.3