summaryrefslogtreecommitdiff
path: root/src/look.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-01 10:16:45 -0300
committerGabriel Schneider <[email protected]>2026-10-01 10:36:27 -0300
commit4d57197f0135c292750731dd19a6df542378135d (patch)
tree520629d486da16e7eec885afb1a4dc8ed3e39624 /src/look.zig
parentecc37bfdc4b5771dfe4bda61b9ffab9ad298950d (diff)
downloadpardes-4d57197f0135c292750731dd19a6df542378135d.tar.gz
pardes-4d57197f0135c292750731dd19a6df542378135d.zip
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 <[email protected]>
Diffstat (limited to 'src/look.zig')
-rw-r--r--src/look.zig5
1 files changed, 5 insertions, 0 deletions
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);
}