diff options
Diffstat (limited to 'core/builtins.zig')
| -rw-r--r-- | core/builtins.zig | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/core/builtins.zig b/core/builtins.zig index 6b291628..a79e4b66 100644 --- a/core/builtins.zig +++ b/core/builtins.zig @@ -493,7 +493,7 @@ pub const Restore = struct { // name. Else a label of the state file's. var full_buf: [4096]u8 = undefined; var label_buf: [256]u8 = undefined; - const file = if (typed) |t| dump.restoreFile(t, c.p.settings.dump_dir.get(), &full_buf) else null; + const file = if (typed) |t| dump.restoreFile(c.p.tape, t, c.p.settings.dump_dir.get(), &full_buf) else null; const name = if (file) |path| path else pardes.tape.authority(pardes.Db.labelled, .{ &c.p.db, c.p, typed, @as([]u8, &label_buf) }) orelse { var buf: pardes.Kind.Buf(320) = .{}; return c.p.reportFailure(c.id, if (typed) |t| buf.print("Restore: no dump labelled {s}", .{t}) else "Restore: no dump yet; name one"); @@ -503,7 +503,7 @@ pub const Restore = struct { // the host reads it only after this step, where nobody hears. // First, so a Restore that could never happen spends no warning. if (file) |path| { - const bytes = @import("fs.zig").readFile(c.p.gpa, path) catch |err| { + const bytes = @import("fs.zig").readFile(c.p.tape, c.p.gpa, path) catch |err| { var buf: pardes.Kind.Buf(limits.host_path_cap + 160) = .{}; var words: [128]u8 = undefined; const why = switch (err) { @@ -583,7 +583,7 @@ pub const Mount = struct { // A socket path that is not there: said so (ENOENT), not a dial // that went unanswered. const sock_path: ?[]const u8 = if (std.mem.startsWith(u8, dial, "unix!")) dial[5..] else if (dial.len > 0 and dial[0] == '/') dial else null; - if (sock_path) |path| if (@import("exec.zig").kindOf(path) == null) { + if (sock_path) |path| if (@import("exec.zig").kindOf(c.p.tape, path) == null) { if (c.p.fs.mounts.pop()) |gone| { c.p.gpa.free(gone.name); c.p.gpa.free(gone.dial); @@ -850,7 +850,7 @@ pub const Get = struct { // edits are asked about: there would be nothing to load over them. if (typed.len > 0) if (@import("fs.zig").localPath(path)) |local| { var said: pardes.Kind.Buf(320) = .{}; - const kind = exec.kindOf(local); + const kind = exec.kindOf(c.p.tape, local); if (kind == null or kind.? == .directory) return c.p.reportFailure(c.id, said.print("Get: {s}: {s}", .{ path[0..@min(path.len, 256)], if (kind == null) "no such file" else "is a directory" })); }; @@ -909,8 +909,8 @@ pub const Incl = struct { return p.reportFailure(c.id, said.print("Incl: invalid directory: {s} is relative", .{shown})); var home_buf: [4096]u8 = undefined; const expanded = p.expandHome(dir_word, &home_buf); - if (@import("fs.zig").localPath(expanded)) |local| if (exec.kindOf(local) != .directory) - return p.reportFailure(c.id, if (exec.kindOf(local) != null) + if (@import("fs.zig").localPath(expanded)) |local| if (exec.kindOf(p.tape, local) != .directory) + return p.reportFailure(c.id, if (exec.kindOf(p.tape, local) != null) said.print("Incl: not a directory: {s}", .{shown}) else said.print("Incl: no such directory: {s}", .{shown})); @@ -1321,7 +1321,7 @@ pub const Config = struct { /// directory. fn openConfigFile(c: Ctx, name: []const u8, path: []const u8, initial: []const u8) void { var real_buf: [4096]u8 = undefined; - const real = if (pardes.filesystem.resolveOs(path, &real_buf)) |r| r.path else null; + const real = if (pardes.filesystem.resolveOs(c.p.tape, path, &real_buf)) |r| r.path else null; for (c.p.panes, 0..) |slot, id| { const pane = slot orelse continue; const f = pane.file orelse continue; |
