summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pardes.zig b/src/pardes.zig
index 945fcafa..f5001797 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -5541,7 +5541,11 @@ pub const Pardes = struct {
const parent = std.fs.path.dirname(path) orelse "/";
const no_dir = err == error.FileNotFound or err == error.NotDir or
(if (comptime hosted) (if (filesystem.localPath(parent)) |local| !exec.isDirectory(local) else false) else false);
- if (no_dir)
+ // Not there because one above refuses: that is the reason, EACCES.
+ const denied = no_dir and (if (comptime hosted) (if (filesystem.localPath(parent)) |local| filesystem.deniedAbove(local) else false) else false);
+ if (denied)
+ p.reportFailure(id, std.fmt.bufPrint(&what, "Save {s}: permission denied", .{path}) catch "Save: permission denied")
+ else if (no_dir)
p.reportFailure(id, std.fmt.bufPrint(&what, "Save {s}: no such directory", .{path}) catch "Save: no such directory")
else
p.reportError(id, std.fmt.bufPrint(&what, "Save {s}", .{path}) catch "Save", err);