authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-01-29 18:47:58-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-01-29 18:47:58-08:00
logb1d1806fef56a72d0df14ad3a54c3074b1e55a69
tree8a66e8db31db8edd8f2aeb8f67d5300e8c650214
parent0a37ad2ec4daa04a845142508e0dd1326db7ee2d

std.process: currentDir -> currentPath

In Zig standard library, Dir means an open directory handle. path represents a file system identifier string. This function is better named after "current path" than "current dir". "get" and "working" are superfluous.

18 files changed, 41 insertions(+), 41 deletions(-)

lib/compiler/build_runner.zig+1-1
...@@ -83,7 +83,7 @@ pub fn main(init: process.Init.Minimal) !void {...@@ -83,7 +83,7 @@ pub fn main(init: process.Init.Minimal) !void {
83 .io = io,83 .io = io,
84 .gpa = gpa,84 .gpa = gpa,
85 .manifest_dir = try local_cache_directory.handle.createDirPathOpen(io, "h", .{}),85 .manifest_dir = try local_cache_directory.handle.createDirPathOpen(io, "h", .{}),
86 .cwd = try process.currentDirAlloc(io, single_threaded_arena.allocator()),86 .cwd = try process.currentPathAlloc(io, single_threaded_arena.allocator()),
87 },87 },
88 .zig_exe = zig_exe,88 .zig_exe = zig_exe,
89 .environ_map = try init.environ.createMap(arena),89 .environ_map = try init.environ.createMap(arena),
lib/std/Build/Cache.zig+4-4
...@@ -1315,7 +1315,7 @@ test "cache file and then recall it" {...@@ -1315,7 +1315,7 @@ test "cache file and then recall it" {
1315 var tmp = testing.tmpDir(.{});1315 var tmp = testing.tmpDir(.{});
1316 defer tmp.cleanup();1316 defer tmp.cleanup();
13171317
1318 const cwd = try std.process.currentDirAlloc(io, testing.allocator);1318 const cwd = try std.process.currentPathAlloc(io, testing.allocator);
1319 defer testing.allocator.free(cwd);1319 defer testing.allocator.free(cwd);
13201320
1321 const temp_file = "test.txt";1321 const temp_file = "test.txt";
...@@ -1383,7 +1383,7 @@ test "check that changing a file makes cache fail" {...@@ -1383,7 +1383,7 @@ test "check that changing a file makes cache fail" {
1383 var tmp = testing.tmpDir(.{});1383 var tmp = testing.tmpDir(.{});
1384 defer tmp.cleanup();1384 defer tmp.cleanup();
13851385
1386 const cwd = try std.process.currentDirAlloc(io, testing.allocator);1386 const cwd = try std.process.currentPathAlloc(io, testing.allocator);
1387 defer testing.allocator.free(cwd);1387 defer testing.allocator.free(cwd);
13881388
1389 const temp_file = "cache_hash_change_file_test.txt";1389 const temp_file = "cache_hash_change_file_test.txt";
...@@ -1459,7 +1459,7 @@ test "no file inputs" {...@@ -1459,7 +1459,7 @@ test "no file inputs" {
1459 var tmp = testing.tmpDir(.{});1459 var tmp = testing.tmpDir(.{});
1460 defer tmp.cleanup();1460 defer tmp.cleanup();
14611461
1462 const cwd = try std.process.currentDirAlloc(io, testing.allocator);1462 const cwd = try std.process.currentPathAlloc(io, testing.allocator);
1463 defer testing.allocator.free(cwd);1463 defer testing.allocator.free(cwd);
14641464
1465 const temp_manifest_dir = "no_file_inputs_manifest_dir";1465 const temp_manifest_dir = "no_file_inputs_manifest_dir";
...@@ -1509,7 +1509,7 @@ test "Manifest with files added after initial hash work" {...@@ -1509,7 +1509,7 @@ test "Manifest with files added after initial hash work" {
1509 var tmp = testing.tmpDir(.{});1509 var tmp = testing.tmpDir(.{});
1510 defer tmp.cleanup();1510 defer tmp.cleanup();
15111511
1512 const cwd = try std.process.currentDirAlloc(io, testing.allocator);1512 const cwd = try std.process.currentPathAlloc(io, testing.allocator);
1513 defer testing.allocator.free(cwd);1513 defer testing.allocator.free(cwd);
15141514
1515 const temp_file1 = "cache_hash_post_file_test1.txt";1515 const temp_file1 = "cache_hash_post_file_test1.txt";
lib/std/Build/Step/Options.zig+1-1
...@@ -519,7 +519,7 @@ test Options {...@@ -519,7 +519,7 @@ test Options {
519 var arena = std.heap.ArenaAllocator.init(std.testing.allocator);519 var arena = std.heap.ArenaAllocator.init(std.testing.allocator);
520 defer arena.deinit();520 defer arena.deinit();
521521
522 const cwd = try std.process.currentDirAlloc(io, std.testing.allocator);522 const cwd = try std.process.currentPathAlloc(io, std.testing.allocator);
523 defer std.testing.allocator.free(cwd);523 defer std.testing.allocator.free(cwd);
524524
525 var graph: std.Build.Graph = .{525 var graph: std.Build.Graph = .{
lib/std/Io.zig+1-1
...@@ -665,7 +665,7 @@ pub const VTable = struct {...@@ -665,7 +665,7 @@ pub const VTable = struct {
665 lockStderr: *const fn (?*anyopaque, ?Terminal.Mode) Cancelable!LockedStderr,665 lockStderr: *const fn (?*anyopaque, ?Terminal.Mode) Cancelable!LockedStderr,
666 tryLockStderr: *const fn (?*anyopaque, ?Terminal.Mode) Cancelable!?LockedStderr,666 tryLockStderr: *const fn (?*anyopaque, ?Terminal.Mode) Cancelable!?LockedStderr,
667 unlockStderr: *const fn (?*anyopaque) void,667 unlockStderr: *const fn (?*anyopaque) void,
668 processCurrentDir: *const fn (?*anyopaque, buffer: []u8) std.process.CurrentDirError!usize,668 processCurrentPath: *const fn (?*anyopaque, buffer: []u8) std.process.CurrentPathError!usize,
669 processSetCurrentDir: *const fn (?*anyopaque, Dir) std.process.SetCurrentDirError!void,669 processSetCurrentDir: *const fn (?*anyopaque, Dir) std.process.SetCurrentDirError!void,
670 processReplace: *const fn (?*anyopaque, std.process.ReplaceOptions) std.process.ReplaceError,670 processReplace: *const fn (?*anyopaque, std.process.ReplaceOptions) std.process.ReplaceError,
671 processReplacePath: *const fn (?*anyopaque, Dir, std.process.ReplaceOptions) std.process.ReplaceError,671 processReplacePath: *const fn (?*anyopaque, Dir, std.process.ReplaceOptions) std.process.ReplaceError,
lib/std/Io/Threaded.zig+4-4
...@@ -1643,7 +1643,7 @@ pub fn io(t: *Threaded) Io {...@@ -1643,7 +1643,7 @@ pub fn io(t: *Threaded) Io {
1643 .lockStderr = lockStderr,1643 .lockStderr = lockStderr,
1644 .tryLockStderr = tryLockStderr,1644 .tryLockStderr = tryLockStderr,
1645 .unlockStderr = unlockStderr,1645 .unlockStderr = unlockStderr,
1646 .processCurrentDir = processCurrentDir,1646 .processCurrentPath = processCurrentPath,
1647 .processSetCurrentDir = processSetCurrentDir,1647 .processSetCurrentDir = processSetCurrentDir,
1648 .processReplace = processReplace,1648 .processReplace = processReplace,
1649 .processReplacePath = processReplacePath,1649 .processReplacePath = processReplacePath,
...@@ -1802,7 +1802,7 @@ pub fn ioBasic(t: *Threaded) Io {...@@ -1802,7 +1802,7 @@ pub fn ioBasic(t: *Threaded) Io {
1802 .lockStderr = lockStderr,1802 .lockStderr = lockStderr,
1803 .tryLockStderr = tryLockStderr,1803 .tryLockStderr = tryLockStderr,
1804 .unlockStderr = unlockStderr,1804 .unlockStderr = unlockStderr,
1805 .processCurrentDir = processCurrentDir,1805 .processCurrentPath = processCurrentPath,
1806 .processSetCurrentDir = processSetCurrentDir,1806 .processSetCurrentDir = processSetCurrentDir,
1807 .processReplace = processReplace,1807 .processReplace = processReplace,
1808 .processReplacePath = processReplacePath,1808 .processReplacePath = processReplacePath,
...@@ -12606,7 +12606,7 @@ fn unlockStderr(userdata: ?*anyopaque) void {...@@ -12606,7 +12606,7 @@ fn unlockStderr(userdata: ?*anyopaque) void {
12606 process.stderr_thread_mutex.unlock();12606 process.stderr_thread_mutex.unlock();
12607}12607}
1260812608
12609fn processCurrentDir(userdata: ?*anyopaque, buffer: []u8) process.CurrentDirError!usize {12609fn processCurrentPath(userdata: ?*anyopaque, buffer: []u8) process.CurrentPathError!usize {
12610 const t: *Threaded = @ptrCast(@alignCast(userdata));12610 const t: *Threaded = @ptrCast(@alignCast(userdata));
12611 _ = t;12611 _ = t;
12612 if (is_windows) {12612 if (is_windows) {
...@@ -12638,7 +12638,7 @@ fn processCurrentDir(userdata: ?*anyopaque, buffer: []u8) process.CurrentDirErro...@@ -12638,7 +12638,7 @@ fn processCurrentDir(userdata: ?*anyopaque, buffer: []u8) process.CurrentDirErro
12638 };12638 };
12639 switch (err) {12639 switch (err) {
12640 .SUCCESS => return std.mem.findScalar(u8, buffer, 0).?,12640 .SUCCESS => return std.mem.findScalar(u8, buffer, 0).?,
12641 .NOENT => return error.CurrentWorkingDirectoryUnlinked,12641 .NOENT => return error.CurrentDirUnlinked,
12642 .RANGE => return error.NameTooLong,12642 .RANGE => return error.NameTooLong,
12643 .FAULT => |e| return errnoBug(e),12643 .FAULT => |e| return errnoBug(e),
12644 .INVAL => |e| return errnoBug(e),12644 .INVAL => |e| return errnoBug(e),
lib/std/fs/test.zig+1-1
...@@ -1787,7 +1787,7 @@ test "open file with exclusive nonblocking lock twice (absolute paths)" {...@@ -1787,7 +1787,7 @@ test "open file with exclusive nonblocking lock twice (absolute paths)" {
17871787
1788 const gpa = testing.allocator;1788 const gpa = testing.allocator;
17891789
1790 const cwd = try std.process.currentDirAlloc(io, gpa);1790 const cwd = try std.process.currentPathAlloc(io, gpa);
1791 defer gpa.free(cwd);1791 defer gpa.free(cwd);
17921792
1793 const filename = try Dir.path.resolve(gpa, &.{ cwd, sub_path });1793 const filename = try Dir.path.resolve(gpa, &.{ cwd, sub_path });
lib/std/process.zig+11-11
...@@ -63,22 +63,22 @@ pub const Init = struct {...@@ -63,22 +63,22 @@ pub const Init = struct {
63 };63 };
64};64};
6565
66pub const CurrentDirError = error{66pub const CurrentPathError = error{
67 NameTooLong,67 NameTooLong,
68 /// Not possible on Windows. Always returned on WASI.68 /// Not possible on Windows. Always returned on WASI.
69 CurrentWorkingDirectoryUnlinked,69 CurrentDirUnlinked,
70} || Io.UnexpectedError;70} || Io.UnexpectedError;
7171
72/// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/).72/// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
73/// On other platforms, the result is an opaque sequence of bytes with no73/// On other platforms, the result is an opaque sequence of bytes with no
74/// particular encoding.74/// particular encoding.
75pub fn currentDir(io: Io, buffer: []u8) CurrentDirError!usize {75pub fn currentPath(io: Io, buffer: []u8) CurrentPathError!usize {
76 return io.vtable.processCurrentDir(io.userdata, buffer);76 return io.vtable.processCurrentPath(io.userdata, buffer);
77}77}
7878
79pub const CurrentDirAllocError = Allocator.Error || error{79pub const CurrentPathAllocError = Allocator.Error || error{
80 /// Not possible on Windows. Always returned on WASI.80 /// Not possible on Windows. Always returned on WASI.
81 CurrentWorkingDirectoryUnlinked,81 CurrentDirUnlinked,
82} || Io.UnexpectedError;82} || Io.UnexpectedError;
8383
84/// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/).84/// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
...@@ -86,17 +86,17 @@ pub const CurrentDirAllocError = Allocator.Error || error{...@@ -86,17 +86,17 @@ pub const CurrentDirAllocError = Allocator.Error || error{
86/// particular encoding.86/// particular encoding.
87///87///
88/// Caller owns returned memory.88/// Caller owns returned memory.
89pub fn currentDirAlloc(io: Io, allocator: Allocator) CurrentDirAllocError![:0]u8 {89pub fn currentPathAlloc(io: Io, allocator: Allocator) CurrentPathAllocError![:0]u8 {
90 var buffer: [max_path_bytes]u8 = undefined;90 var buffer: [max_path_bytes]u8 = undefined;
91 const n = currentDir(io, &buffer) catch |err| switch (err) {91 const n = currentPath(io, &buffer) catch |err| switch (err) {
92 error.NameTooLong => unreachable,92 error.NameTooLong => unreachable,
93 else => |e| return e,93 else => |e| return e,
94 };94 };
95 return allocator.dupeZ(u8, buffer[0..n]);95 return allocator.dupeZ(u8, buffer[0..n]);
96}96}
9797
98test currentDirAlloc {98test currentPathAlloc {
99 const cwd = try currentDirAlloc(testing.io, testing.allocator);99 const cwd = try currentPathAlloc(testing.io, testing.allocator);
100 testing.allocator.free(cwd);100 testing.allocator.free(cwd);
101}101}
102102
...@@ -453,7 +453,7 @@ pub fn spawnPath(io: Io, dir: Io.Dir, options: SpawnOptions) SpawnError!Child {...@@ -453,7 +453,7 @@ pub fn spawnPath(io: Io, dir: Io.Dir, options: SpawnOptions) SpawnError!Child {
453 return io.vtable.processSpawnPath(io.userdata, dir, options);453 return io.vtable.processSpawnPath(io.userdata, dir, options);
454}454}
455455
456pub const RunError = CurrentDirError || posix.ReadError || SpawnError || posix.PollError || error{456pub const RunError = CurrentPathError || posix.ReadError || SpawnError || posix.PollError || error{
457 StdoutStreamTooLong,457 StdoutStreamTooLong,
458 StderrStreamTooLong,458 StderrStreamTooLong,
459};459};
src/introspect.zig+4-4
...@@ -51,23 +51,23 @@ pub fn findZigLibDir(gpa: Allocator, io: Io) !Cache.Directory {...@@ -51,23 +51,23 @@ pub fn findZigLibDir(gpa: Allocator, io: Io) !Cache.Directory {
51 return findZigLibDirFromSelfExe(gpa, io, cwd_path, self_exe_path);51 return findZigLibDirFromSelfExe(gpa, io, cwd_path, self_exe_path);
52}52}
5353
54/// Like `std.process.currentDirAlloc`, but also resolves the path with `Dir.path.resolve`. This54/// Like `std.process.currentPathAlloc`, but also resolves the path with `Dir.path.resolve`. This
55/// means the path has no repeated separators, no "." or ".." components, and no trailing separator.55/// means the path has no repeated separators, no "." or ".." components, and no trailing separator.
56/// On WASI, "" is returned instead of ".".56/// On WASI, "" is returned instead of ".".
57pub fn getResolvedCwd(io: Io, gpa: Allocator) error{57pub fn getResolvedCwd(io: Io, gpa: Allocator) error{
58 OutOfMemory,58 OutOfMemory,
59 CurrentWorkingDirectoryUnlinked,59 CurrentDirUnlinked,
60 Unexpected,60 Unexpected,
61}![]u8 {61}![]u8 {
62 if (builtin.target.os.tag == .wasi) {62 if (builtin.target.os.tag == .wasi) {
63 if (std.debug.runtime_safety) {63 if (std.debug.runtime_safety) {
64 const cwd = try std.process.currentDirAlloc(io, gpa);64 const cwd = try std.process.currentPathAlloc(io, gpa);
65 defer gpa.free(cwd);65 defer gpa.free(cwd);
66 assert(mem.eql(u8, cwd, "."));66 assert(mem.eql(u8, cwd, "."));
67 }67 }
68 return "";68 return "";
69 }69 }
70 const cwd = try std.process.currentDirAlloc(io, gpa);70 const cwd = try std.process.currentPathAlloc(io, gpa);
71 defer gpa.free(cwd);71 defer gpa.free(cwd);
72 const resolved = try Dir.path.resolve(gpa, &.{cwd});72 const resolved = try Dir.path.resolve(gpa, &.{cwd});
73 assert(Dir.path.isAbsolute(resolved));73 assert(Dir.path.isAbsolute(resolved));
test/standalone/child_process/main.zig+1-1
...@@ -16,7 +16,7 @@ pub fn main(init: std.process.Init.Minimal) !void {...@@ -16,7 +16,7 @@ pub fn main(init: std.process.Init.Minimal) !void {
16 defer threaded.deinit();16 defer threaded.deinit();
17 const io = threaded.io();17 const io = threaded.io();
1818
19 const process_cwd_path = try std.process.currentDirAlloc(io, gpa);19 const process_cwd_path = try std.process.currentPathAlloc(io, gpa);
20 defer gpa.free(process_cwd_path);20 defer gpa.free(process_cwd_path);
2121
22 var environ_map = try init.environ.createMap(gpa);22 var environ_map = try init.environ.createMap(gpa);
test/standalone/posix/cwd.zig+5-5
...@@ -28,13 +28,13 @@ pub fn main(init: std.process.Init) !void {...@@ -28,13 +28,13 @@ pub fn main(init: std.process.Init) !void {
28// get current working directory and expect it to match given path28// get current working directory and expect it to match given path
29fn expect_cwd(io: Io, expected_cwd: []const u8) !void {29fn expect_cwd(io: Io, expected_cwd: []const u8) !void {
30 var cwd_buf: [path_max]u8 = undefined;30 var cwd_buf: [path_max]u8 = undefined;
31 const actual_cwd = cwd_buf[0..try std.process.currentDir(io, &cwd_buf)];31 const actual_cwd = cwd_buf[0..try std.process.currentPath(io, &cwd_buf)];
32 try std.testing.expectEqualStrings(actual_cwd, expected_cwd);32 try std.testing.expectEqualStrings(actual_cwd, expected_cwd);
33}33}
3434
35fn test_chdir_self(io: Io) !void {35fn test_chdir_self(io: Io) !void {
36 var old_cwd_buf: [path_max]u8 = undefined;36 var old_cwd_buf: [path_max]u8 = undefined;
37 const old_cwd = old_cwd_buf[0..try std.process.currentDir(io, &old_cwd_buf)];37 const old_cwd = old_cwd_buf[0..try std.process.currentPath(io, &old_cwd_buf)];
3838
39 // Try changing to the current directory39 // Try changing to the current directory
40 try std.Io.Threaded.chdir(old_cwd);40 try std.Io.Threaded.chdir(old_cwd);
...@@ -43,7 +43,7 @@ fn test_chdir_self(io: Io) !void {...@@ -43,7 +43,7 @@ fn test_chdir_self(io: Io) !void {
4343
44fn test_chdir_absolute(io: Io) !void {44fn test_chdir_absolute(io: Io) !void {
45 var old_cwd_buf: [path_max]u8 = undefined;45 var old_cwd_buf: [path_max]u8 = undefined;
46 const old_cwd = old_cwd_buf[0..try std.process.currentDir(io, &old_cwd_buf)];46 const old_cwd = old_cwd_buf[0..try std.process.currentPath(io, &old_cwd_buf)];
4747
48 const parent = std.fs.path.dirname(old_cwd) orelse unreachable; // old_cwd should be absolute48 const parent = std.fs.path.dirname(old_cwd) orelse unreachable; // old_cwd should be absolute
4949
...@@ -62,7 +62,7 @@ fn test_chdir_relative(gpa: Allocator, io: Io, tmp_dir: Io.Dir) !void {...@@ -62,7 +62,7 @@ fn test_chdir_relative(gpa: Allocator, io: Io, tmp_dir: Io.Dir) !void {
6262
63 // Capture base working directory path, to build expected full path63 // Capture base working directory path, to build expected full path
64 var base_cwd_buf: [path_max]u8 = undefined;64 var base_cwd_buf: [path_max]u8 = undefined;
65 const base_cwd = base_cwd_buf[0..try std.process.currentDir(io, &base_cwd_buf)];65 const base_cwd = base_cwd_buf[0..try std.process.currentPath(io, &base_cwd_buf)];
6666
67 const expected_path = try std.fs.path.resolve(gpa, &.{ base_cwd, subdir_path });67 const expected_path = try std.fs.path.resolve(gpa, &.{ base_cwd, subdir_path });
68 defer gpa.free(expected_path);68 defer gpa.free(expected_path);
...@@ -71,7 +71,7 @@ fn test_chdir_relative(gpa: Allocator, io: Io, tmp_dir: Io.Dir) !void {...@@ -71,7 +71,7 @@ fn test_chdir_relative(gpa: Allocator, io: Io, tmp_dir: Io.Dir) !void {
71 try std.Io.Threaded.chdir(subdir_path);71 try std.Io.Threaded.chdir(subdir_path);
7272
73 var new_cwd_buf: [path_max]u8 = undefined;73 var new_cwd_buf: [path_max]u8 = undefined;
74 const new_cwd = new_cwd_buf[0..try std.process.currentDir(io, &new_cwd_buf)];74 const new_cwd = new_cwd_buf[0..try std.process.currentPath(io, &new_cwd_buf)];
7575
76 // On Windows, fs.path.resolve returns an uppercase drive letter, but the drive letter returned by getcwd may be lowercase76 // On Windows, fs.path.resolve returns an uppercase drive letter, but the drive letter returned by getcwd may be lowercase
77 const resolved_cwd = try std.fs.path.resolve(gpa, &.{new_cwd});77 const resolved_cwd = try std.fs.path.resolve(gpa, &.{new_cwd});
test/standalone/self_exe_symlink/create-symlink.zig+1-1
...@@ -9,7 +9,7 @@ pub fn main(init: std.process.Init) !void {...@@ -9,7 +9,7 @@ pub fn main(init: std.process.Init) !void {
9 const exe_path = it.next() orelse unreachable;9 const exe_path = it.next() orelse unreachable;
10 const symlink_path = it.next() orelse unreachable;10 const symlink_path = it.next() orelse unreachable;
1111
12 const cwd = try std.process.currentDirAlloc(io, init.arena.allocator());12 const cwd = try std.process.currentPathAlloc(io, init.arena.allocator());
1313
14 // If `exe_path` is relative to our cwd, we need to convert it to be relative to the dirname of `symlink_path`.14 // If `exe_path` is relative to our cwd, we need to convert it to be relative to the dirname of `symlink_path`.
15 const exe_rel_path = try std.fs.path.relative(gpa, cwd, init.environ_map, std.fs.path.dirname(symlink_path) orelse ".", exe_path);15 const exe_rel_path = try std.fs.path.relative(gpa, cwd, init.environ_map, std.fs.path.dirname(symlink_path) orelse ".", exe_path);
test/standalone/windows_paths/relative.zig+1-1
...@@ -4,7 +4,7 @@ pub fn main(init: std.process.Init) !void {...@@ -4,7 +4,7 @@ pub fn main(init: std.process.Init) !void {
4 const arena = init.arena.allocator();4 const arena = init.arena.allocator();
5 const args = try init.minimal.args.toSlice(arena);5 const args = try init.minimal.args.toSlice(arena);
6 const io = init.io;6 const io = init.io;
7 const cwd_path = try std.process.currentDirAlloc(io, arena);7 const cwd_path = try std.process.currentPathAlloc(io, arena);
88
9 if (args.len < 3) return error.MissingArgs;9 if (args.len < 3) return error.MissingArgs;
1010
test/standalone/windows_paths/test.zig+1-1
...@@ -10,7 +10,7 @@ pub fn main(init: std.process.Init) !void {...@@ -10,7 +10,7 @@ pub fn main(init: std.process.Init) !void {
1010
11 const exe_path = args[1];11 const exe_path = args[1];
1212
13 const cwd_path = try std.process.currentDirAlloc(io, arena);13 const cwd_path = try std.process.currentPathAlloc(io, arena);
14 const parsed_cwd_path = std.fs.path.parsePathWindows(u8, cwd_path);14 const parsed_cwd_path = std.fs.path.parsePathWindows(u8, cwd_path);
1515
16 if (parsed_cwd_path.kind == .drive_absolute and !std.ascii.isAlphabetic(cwd_path[0])) {16 if (parsed_cwd_path.kind == .drive_absolute and !std.ascii.isAlphabetic(cwd_path[0])) {
test/standalone/windows_spawn/main.zig+1-1
...@@ -8,7 +8,7 @@ const utf16Literal = std.unicode.utf8ToUtf16LeStringLiteral;...@@ -8,7 +8,7 @@ const utf16Literal = std.unicode.utf8ToUtf16LeStringLiteral;
8pub fn main(init: std.process.Init) !void {8pub fn main(init: std.process.Init) !void {
9 const gpa = init.gpa;9 const gpa = init.gpa;
10 const io = init.io;10 const io = init.io;
11 const process_cwd_path = try std.process.currentDirAlloc(io, init.arena.allocator());11 const process_cwd_path = try std.process.currentPathAlloc(io, init.arena.allocator());
12 var initial_process_cwd = try Io.Dir.cwd().openDir(io, ".", .{});12 var initial_process_cwd = try Io.Dir.cwd().openDir(io, ".", .{});
13 defer initial_process_cwd.close(io);13 defer initial_process_cwd.close(io);
1414
tools/doctest.zig+1-1
...@@ -33,7 +33,7 @@ pub fn main(init: std.process.Init) !void {...@@ -33,7 +33,7 @@ pub fn main(init: std.process.Init) !void {
33 const arena = init.arena.allocator();33 const arena = init.arena.allocator();
34 const io = init.io;34 const io = init.io;
35 const environ_map = init.environ_map;35 const environ_map = init.environ_map;
36 const cwd_path = try std.process.currentDirAlloc(io, arena);36 const cwd_path = try std.process.currentPathAlloc(io, arena);
3737
38 try environ_map.put("CLICOLOR_FORCE", "1");38 try environ_map.put("CLICOLOR_FORCE", "1");
3939
tools/incr-check.zig+1-1
...@@ -32,7 +32,7 @@ pub fn main(init: std.process.Init) !void {...@@ -32,7 +32,7 @@ pub fn main(init: std.process.Init) !void {
32 const arena = init.arena.allocator();32 const arena = init.arena.allocator();
33 const io = init.io;33 const io = init.io;
34 const environ_map = init.environ_map;34 const environ_map = init.environ_map;
35 const cwd_path = try std.process.currentDirAlloc(io, arena);35 const cwd_path = try std.process.currentPathAlloc(io, arena);
3636
37 var opt_zig_exe: ?[]const u8 = null;37 var opt_zig_exe: ?[]const u8 = null;
38 var opt_input_file_name: ?[]const u8 = null;38 var opt_input_file_name: ?[]const u8 = null;
tools/process_headers.zig+1-1
...@@ -145,7 +145,7 @@ pub fn main(init: std.process.Init) !void {...@@ -145,7 +145,7 @@ pub fn main(init: std.process.Init) !void {
145 const arena = init.arena.allocator();145 const arena = init.arena.allocator();
146 const io = init.io;146 const io = init.io;
147 const args = try init.minimal.args.toSlice(arena);147 const args = try init.minimal.args.toSlice(arena);
148 const cwd_path = try std.process.currentDirAlloc(io, arena);148 const cwd_path = try std.process.currentPathAlloc(io, arena);
149 const environ_map = init.environ_map;149 const environ_map = init.environ_map;
150150
151 var search_paths = std.array_list.Managed([]const u8).init(arena);151 var search_paths = std.array_list.Managed([]const u8).init(arena);
tools/update-linux-headers.zig+1-1
...@@ -146,7 +146,7 @@ pub fn main(init: std.process.Init) !void {...@@ -146,7 +146,7 @@ pub fn main(init: std.process.Init) !void {
146 const io = init.io;146 const io = init.io;
147 const args = try init.minimal.args.toSlice(arena);147 const args = try init.minimal.args.toSlice(arena);
148 const environ_map = init.environ_map;148 const environ_map = init.environ_map;
149 const cwd = try std.process.currentDirAlloc(io, arena);149 const cwd = try std.process.currentPathAlloc(io, arena);
150150
151 var search_paths = std.array_list.Managed([]const u8).init(arena);151 var search_paths = std.array_list.Managed([]const u8).init(arena);
152 var opt_out_dir: ?[]const u8 = null;152 var opt_out_dir: ?[]const u8 = null;