authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-12-19 16:21:54-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-12-23 22:15:11-08:00
log6e0c7ed8659d9d60a59a9dcddd3aed9cd18b659b
tree637d71ea08261d2483f33de3847d43af01bafbcc
parent52ba2a4c72cee39292d09506655197811feceede

std: rename makeDir to createDir for consistency with createFile


6 files changed, 44 insertions(+), 44 deletions(-)

lib/std/Io/Dir.zig+6-6
...@@ -664,25 +664,25 @@ pub const MakeError = error{...@@ -664,25 +664,25 @@ pub const MakeError = error{
664///664///
665/// Related:665/// Related:
666/// * `makePath`666/// * `makePath`
667/// * `makeDirAbsolute`667/// * `createDirAbsolute`
668pub fn makeDir(dir: Dir, io: Io, sub_path: []const u8, permissions: Permissions) MakeError!void {668pub fn createDir(dir: Dir, io: Io, sub_path: []const u8, permissions: Permissions) MakeError!void {
669 return io.vtable.dirMake(io.userdata, dir, sub_path, permissions);669 return io.vtable.dirMake(io.userdata, dir, sub_path, permissions);
670}670}
671671
672/// Create a new directory, based on an absolute path.672/// Create a new directory, based on an absolute path.
673///673///
674/// Asserts that the path is absolute. See `makeDir` for a function that674/// Asserts that the path is absolute. See `createDir` for a function that
675/// operates on both absolute and relative paths.675/// operates on both absolute and relative paths.
676///676///
677/// On Windows, `absolute_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).677/// On Windows, `absolute_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
678/// On WASI, `absolute_path` should be encoded as valid UTF-8.678/// On WASI, `absolute_path` should be encoded as valid UTF-8.
679/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding.679/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding.
680pub fn makeDirAbsolute(io: Io, absolute_path: []const u8, permissions: Permissions) MakeError!void {680pub fn createDirAbsolute(io: Io, absolute_path: []const u8, permissions: Permissions) MakeError!void {
681 assert(path.isAbsolute(absolute_path));681 assert(path.isAbsolute(absolute_path));
682 return makeDir(.cwd(), io, absolute_path, permissions);682 return createDir(.cwd(), io, absolute_path, permissions);
683}683}
684684
685test makeDirAbsolute {}685test createDirAbsolute {}
686686
687pub const MakePathError = MakeError || StatFileError;687pub const MakePathError = MakeError || StatFileError;
688688
lib/std/fs/test.zig+33-33
...@@ -209,7 +209,7 @@ test "Dir.readLink" {...@@ -209,7 +209,7 @@ test "Dir.readLink" {
209 const file_target_path = try ctx.transformPath("file.txt");209 const file_target_path = try ctx.transformPath("file.txt");
210 try ctx.dir.writeFile(io, .{ .sub_path = file_target_path, .data = "nonsense" });210 try ctx.dir.writeFile(io, .{ .sub_path = file_target_path, .data = "nonsense" });
211 const dir_target_path = try ctx.transformPath("subdir");211 const dir_target_path = try ctx.transformPath("subdir");
212 try ctx.dir.makeDir(io, dir_target_path, .default_dir);212 try ctx.dir.createDir(io, dir_target_path, .default_dir);
213213
214 // On Windows, symlink targets always use the canonical path separator214 // On Windows, symlink targets always use the canonical path separator
215 const canonical_file_target_path = try ctx.toCanonicalPathSep(file_target_path);215 const canonical_file_target_path = try ctx.toCanonicalPathSep(file_target_path);
...@@ -241,7 +241,7 @@ test "Dir.readLink on non-symlinks" {...@@ -241,7 +241,7 @@ test "Dir.readLink on non-symlinks" {
241 const file_path = try ctx.transformPath("file.txt");241 const file_path = try ctx.transformPath("file.txt");
242 try ctx.dir.writeFile(io, .{ .sub_path = file_path, .data = "nonsense" });242 try ctx.dir.writeFile(io, .{ .sub_path = file_path, .data = "nonsense" });
243 const dir_path = try ctx.transformPath("subdir");243 const dir_path = try ctx.transformPath("subdir");
244 try ctx.dir.makeDir(io, dir_path, .default_dir);244 try ctx.dir.createDir(io, dir_path, .default_dir);
245245
246 // file246 // file
247 var buffer: [Dir.max_path_bytes]u8 = undefined;247 var buffer: [Dir.max_path_bytes]u8 = undefined;
...@@ -278,7 +278,7 @@ test "File.stat on a File that is a symlink returns Kind.sym_link" {...@@ -278,7 +278,7 @@ test "File.stat on a File that is a symlink returns Kind.sym_link" {
278 try testWithAllSupportedPathTypes(struct {278 try testWithAllSupportedPathTypes(struct {
279 fn impl(ctx: *TestContext) !void {279 fn impl(ctx: *TestContext) !void {
280 const dir_target_path = try ctx.transformPath("subdir");280 const dir_target_path = try ctx.transformPath("subdir");
281 try ctx.dir.makeDir(io, dir_target_path, .default_dir);281 try ctx.dir.createDir(io, dir_target_path, .default_dir);
282282
283 try setupSymlink(io, ctx.dir, dir_target_path, "symlink", .{ .is_directory = true });283 try setupSymlink(io, ctx.dir, dir_target_path, "symlink", .{ .is_directory = true });
284284
...@@ -301,7 +301,7 @@ test "openDir" {...@@ -301,7 +301,7 @@ test "openDir" {
301 fn impl(ctx: *TestContext) !void {301 fn impl(ctx: *TestContext) !void {
302 const allocator = ctx.arena.allocator();302 const allocator = ctx.arena.allocator();
303 const subdir_path = try ctx.transformPath("subdir");303 const subdir_path = try ctx.transformPath("subdir");
304 try ctx.dir.makeDir(io, subdir_path, .default_dir);304 try ctx.dir.createDir(io, subdir_path, .default_dir);
305305
306 for ([_][]const u8{ "", ".", ".." }) |sub_path| {306 for ([_][]const u8{ "", ".", ".." }) |sub_path| {
307 const dir_path = try Dir.path.join(allocator, &.{ subdir_path, sub_path });307 const dir_path = try Dir.path.join(allocator, &.{ subdir_path, sub_path });
...@@ -340,7 +340,7 @@ test "openDirAbsolute" {...@@ -340,7 +340,7 @@ test "openDirAbsolute" {
340340
341 const tmp_ino = (try tmp.dir.stat(io)).inode;341 const tmp_ino = (try tmp.dir.stat(io)).inode;
342342
343 try tmp.dir.makeDir(io, "subdir", .default_dir);343 try tmp.dir.createDir(io, "subdir", .default_dir);
344 const sub_path = try tmp.dir.realPathFileAlloc(io, "subdir", gpa);344 const sub_path = try tmp.dir.realPathFileAlloc(io, "subdir", gpa);
345 defer gpa.free(sub_path);345 defer gpa.free(sub_path);
346346
...@@ -437,7 +437,7 @@ test "readLinkAbsolute" {...@@ -437,7 +437,7 @@ test "readLinkAbsolute" {
437437
438 // Create some targets438 // Create some targets
439 try tmp.dir.writeFile(io, .{ .sub_path = "file.txt", .data = "nonsense" });439 try tmp.dir.writeFile(io, .{ .sub_path = "file.txt", .data = "nonsense" });
440 try tmp.dir.makeDir(io, "subdir", .default_dir);440 try tmp.dir.createDir(io, "subdir", .default_dir);
441441
442 // Get base abs path442 // Get base abs path
443 var arena_allocator = ArenaAllocator.init(testing.allocator);443 var arena_allocator = ArenaAllocator.init(testing.allocator);
...@@ -474,7 +474,7 @@ test "Dir.Iterator" {...@@ -474,7 +474,7 @@ test "Dir.Iterator" {
474 const file = try tmp_dir.dir.createFile(io, "some_file", .{});474 const file = try tmp_dir.dir.createFile(io, "some_file", .{});
475 file.close(io);475 file.close(io);
476476
477 try tmp_dir.dir.makeDir(io, "some_dir", .default_dir);477 try tmp_dir.dir.createDir(io, "some_dir", .default_dir);
478478
479 var arena = ArenaAllocator.init(testing.allocator);479 var arena = ArenaAllocator.init(testing.allocator);
480 defer arena.deinit();480 defer arena.deinit();
...@@ -543,7 +543,7 @@ test "Dir.Iterator twice" {...@@ -543,7 +543,7 @@ test "Dir.Iterator twice" {
543 const file = try tmp_dir.dir.createFile(io, "some_file", .{});543 const file = try tmp_dir.dir.createFile(io, "some_file", .{});
544 file.close(io);544 file.close(io);
545545
546 try tmp_dir.dir.makeDir(io, "some_dir", .default_dir);546 try tmp_dir.dir.createDir(io, "some_dir", .default_dir);
547547
548 var arena = ArenaAllocator.init(testing.allocator);548 var arena = ArenaAllocator.init(testing.allocator);
549 defer arena.deinit();549 defer arena.deinit();
...@@ -578,7 +578,7 @@ test "Dir.Iterator reset" {...@@ -578,7 +578,7 @@ test "Dir.Iterator reset" {
578 const file = try tmp_dir.dir.createFile(io, "some_file", .{});578 const file = try tmp_dir.dir.createFile(io, "some_file", .{});
579 file.close(io);579 file.close(io);
580580
581 try tmp_dir.dir.makeDir(io, "some_dir", .default_dir);581 try tmp_dir.dir.createDir(io, "some_dir", .default_dir);
582582
583 var arena = ArenaAllocator.init(testing.allocator);583 var arena = ArenaAllocator.init(testing.allocator);
584 defer arena.deinit();584 defer arena.deinit();
...@@ -662,7 +662,7 @@ test "Dir.realPath smoke test" {...@@ -662,7 +662,7 @@ test "Dir.realPath smoke test" {
662662
663 // Now create the file and dir663 // Now create the file and dir
664 try ctx.dir.writeFile(io, .{ .sub_path = test_file_path, .data = "" });664 try ctx.dir.writeFile(io, .{ .sub_path = test_file_path, .data = "" });
665 try ctx.dir.makeDir(io, test_dir_path, .default_dir);665 try ctx.dir.createDir(io, test_dir_path, .default_dir);
666666
667 const base_path = try ctx.transformPath(".");667 const base_path = try ctx.transformPath(".");
668 const base_realpath = try ctx.dir.realPathFileAlloc(io, base_path, arena);668 const base_realpath = try ctx.dir.realPathFileAlloc(io, base_path, arena);
...@@ -754,7 +754,7 @@ test "Dir.statFile" {...@@ -754,7 +754,7 @@ test "Dir.statFile" {
754754
755 try expectError(error.FileNotFound, ctx.dir.statFile(io, test_dir_name, .{}));755 try expectError(error.FileNotFound, ctx.dir.statFile(io, test_dir_name, .{}));
756756
757 try ctx.dir.makeDir(io, test_dir_name, .default_dir);757 try ctx.dir.createDir(io, test_dir_name, .default_dir);
758758
759 const stat = try ctx.dir.statFile(io, test_dir_name, .{});759 const stat = try ctx.dir.statFile(io, test_dir_name, .{});
760 try expectEqual(.directory, stat.kind);760 try expectEqual(.directory, stat.kind);
...@@ -787,12 +787,12 @@ test "directory operations on files" {...@@ -787,12 +787,12 @@ test "directory operations on files" {
787 var file = try ctx.dir.createFile(io, test_file_name, .{ .read = true });787 var file = try ctx.dir.createFile(io, test_file_name, .{ .read = true });
788 file.close(io);788 file.close(io);
789789
790 try expectError(error.PathAlreadyExists, ctx.dir.makeDir(io, test_file_name, .default_dir));790 try expectError(error.PathAlreadyExists, ctx.dir.createDir(io, test_file_name, .default_dir));
791 try expectError(error.NotDir, ctx.dir.openDir(io, test_file_name, .{}));791 try expectError(error.NotDir, ctx.dir.openDir(io, test_file_name, .{}));
792 try expectError(error.NotDir, ctx.dir.deleteDir(io, test_file_name));792 try expectError(error.NotDir, ctx.dir.deleteDir(io, test_file_name));
793793
794 if (ctx.path_type == .absolute and comptime PathType.absolute.isSupported(builtin.os)) {794 if (ctx.path_type == .absolute and comptime PathType.absolute.isSupported(builtin.os)) {
795 try expectError(error.PathAlreadyExists, Dir.makeDirAbsolute(io, test_file_name, .default_dir));795 try expectError(error.PathAlreadyExists, Dir.createDirAbsolute(io, test_file_name, .default_dir));
796 try expectError(error.NotDir, Dir.deleteDirAbsolute(io, test_file_name));796 try expectError(error.NotDir, Dir.deleteDirAbsolute(io, test_file_name));
797 }797 }
798798
...@@ -815,7 +815,7 @@ test "file operations on directories" {...@@ -815,7 +815,7 @@ test "file operations on directories" {
815 fn impl(ctx: *TestContext) !void {815 fn impl(ctx: *TestContext) !void {
816 const test_dir_name = try ctx.transformPath("test_dir");816 const test_dir_name = try ctx.transformPath("test_dir");
817817
818 try ctx.dir.makeDir(io, test_dir_name, .default_dir);818 try ctx.dir.createDir(io, test_dir_name, .default_dir);
819819
820 try expectError(error.IsDir, ctx.dir.createFile(io, test_dir_name, .{}));820 try expectError(error.IsDir, ctx.dir.createFile(io, test_dir_name, .{}));
821 try expectError(error.IsDir, ctx.dir.deleteFile(io, test_dir_name));821 try expectError(error.IsDir, ctx.dir.deleteFile(io, test_dir_name));
...@@ -887,7 +887,7 @@ test "deleteDir" {...@@ -887,7 +887,7 @@ test "deleteDir" {
887 try expectError(error.FileNotFound, ctx.dir.deleteDir(io, test_dir_path));887 try expectError(error.FileNotFound, ctx.dir.deleteDir(io, test_dir_path));
888888
889 // deleting a non-empty directory889 // deleting a non-empty directory
890 try ctx.dir.makeDir(io, test_dir_path, .default_dir);890 try ctx.dir.createDir(io, test_dir_path, .default_dir);
891 try ctx.dir.writeFile(io, .{ .sub_path = test_file_path, .data = "" });891 try ctx.dir.writeFile(io, .{ .sub_path = test_file_path, .data = "" });
892 try expectError(error.DirNotEmpty, ctx.dir.deleteDir(io, test_dir_path));892 try expectError(error.DirNotEmpty, ctx.dir.deleteDir(io, test_dir_path));
893893
...@@ -956,7 +956,7 @@ test "Dir.rename directories" {...@@ -956,7 +956,7 @@ test "Dir.rename directories" {
956 const test_dir_renamed_path = try ctx.transformPath("test_dir_renamed");956 const test_dir_renamed_path = try ctx.transformPath("test_dir_renamed");
957957
958 // Renaming directories958 // Renaming directories
959 try ctx.dir.makeDir(io, test_dir_path, .default_dir);959 try ctx.dir.createDir(io, test_dir_path, .default_dir);
960 try ctx.dir.rename(test_dir_path, ctx.dir, test_dir_renamed_path, io);960 try ctx.dir.rename(test_dir_path, ctx.dir, test_dir_renamed_path, io);
961961
962 // Ensure the directory was renamed962 // Ensure the directory was renamed
...@@ -992,8 +992,8 @@ test "Dir.rename directory onto empty dir" {...@@ -992,8 +992,8 @@ test "Dir.rename directory onto empty dir" {
992 const test_dir_path = try ctx.transformPath("test_dir");992 const test_dir_path = try ctx.transformPath("test_dir");
993 const target_dir_path = try ctx.transformPath("target_dir_path");993 const target_dir_path = try ctx.transformPath("target_dir_path");
994994
995 try ctx.dir.makeDir(io, test_dir_path, .default_dir);995 try ctx.dir.createDir(io, test_dir_path, .default_dir);
996 try ctx.dir.makeDir(io, target_dir_path, .default_dir);996 try ctx.dir.createDir(io, target_dir_path, .default_dir);
997 try ctx.dir.rename(test_dir_path, ctx.dir, target_dir_path, io);997 try ctx.dir.rename(test_dir_path, ctx.dir, target_dir_path, io);
998998
999 // Ensure the directory was renamed999 // Ensure the directory was renamed
...@@ -1014,7 +1014,7 @@ test "Dir.rename directory onto non-empty dir" {...@@ -1014,7 +1014,7 @@ test "Dir.rename directory onto non-empty dir" {
1014 const test_dir_path = try ctx.transformPath("test_dir");1014 const test_dir_path = try ctx.transformPath("test_dir");
1015 const target_dir_path = try ctx.transformPath("target_dir_path");1015 const target_dir_path = try ctx.transformPath("target_dir_path");
10161016
1017 try ctx.dir.makeDir(io, test_dir_path, .default_dir);1017 try ctx.dir.createDir(io, test_dir_path, .default_dir);
10181018
1019 var target_dir = try ctx.dir.makeOpenPath(io, target_dir_path, .{});1019 var target_dir = try ctx.dir.makeOpenPath(io, target_dir_path, .{});
1020 var file = try target_dir.createFile(io, "test_file", .{ .read = true });1020 var file = try target_dir.createFile(io, "test_file", .{ .read = true });
...@@ -1043,7 +1043,7 @@ test "Dir.rename file <-> dir" {...@@ -1043,7 +1043,7 @@ test "Dir.rename file <-> dir" {
10431043
1044 var file = try ctx.dir.createFile(io, test_file_path, .{ .read = true });1044 var file = try ctx.dir.createFile(io, test_file_path, .{ .read = true });
1045 file.close(io);1045 file.close(io);
1046 try ctx.dir.makeDir(io, test_dir_path, .default_dir);1046 try ctx.dir.createDir(io, test_dir_path, .default_dir);
1047 try expectError(error.IsDir, ctx.dir.rename(test_file_path, ctx.dir, test_dir_path, io));1047 try expectError(error.IsDir, ctx.dir.rename(test_file_path, ctx.dir, test_dir_path, io));
1048 try expectError(error.NotDir, ctx.dir.rename(test_dir_path, ctx.dir, test_file_path, io));1048 try expectError(error.NotDir, ctx.dir.rename(test_dir_path, ctx.dir, test_file_path, io));
1049 }1049 }
...@@ -1115,7 +1115,7 @@ test "renameAbsolute" {...@@ -1115,7 +1115,7 @@ test "renameAbsolute" {
1115 // Renaming directories1115 // Renaming directories
1116 const test_dir_name = "test_dir";1116 const test_dir_name = "test_dir";
1117 const renamed_test_dir_name = "test_dir_renamed";1117 const renamed_test_dir_name = "test_dir_renamed";
1118 try tmp_dir.dir.makeDir(io, test_dir_name, .default_dir);1118 try tmp_dir.dir.createDir(io, test_dir_name, .default_dir);
1119 try Dir.renameAbsolute(1119 try Dir.renameAbsolute(
1120 try Dir.path.join(allocator, &.{ base_path, test_dir_name }),1120 try Dir.path.join(allocator, &.{ base_path, test_dir_name }),
1121 try Dir.path.join(allocator, &.{ base_path, renamed_test_dir_name }),1121 try Dir.path.join(allocator, &.{ base_path, renamed_test_dir_name }),
...@@ -1256,7 +1256,7 @@ test "makePath but sub_path contains pre-existing file" {...@@ -1256,7 +1256,7 @@ test "makePath but sub_path contains pre-existing file" {
1256 var tmp = tmpDir(.{});1256 var tmp = tmpDir(.{});
1257 defer tmp.cleanup();1257 defer tmp.cleanup();
12581258
1259 try tmp.dir.makeDir(io, "foo", .default_dir);1259 try tmp.dir.createDir(io, "foo", .default_dir);
1260 try tmp.dir.writeFile(io, .{ .sub_path = "foo/bar", .data = "" });1260 try tmp.dir.writeFile(io, .{ .sub_path = "foo/bar", .data = "" });
12611261
1262 try expectError(error.NotDir, tmp.dir.makePath(io, "foo/bar/baz"));1262 try expectError(error.NotDir, tmp.dir.makePath(io, "foo/bar/baz"));
...@@ -1273,10 +1273,10 @@ test "makepath existing directories" {...@@ -1273,10 +1273,10 @@ test "makepath existing directories" {
1273 var tmp = tmpDir(.{});1273 var tmp = tmpDir(.{});
1274 defer tmp.cleanup();1274 defer tmp.cleanup();
12751275
1276 try tmp.dir.makeDir(io, "A", .default_dir);1276 try tmp.dir.createDir(io, "A", .default_dir);
1277 var tmpA = try tmp.dir.openDir(io, "A", .{});1277 var tmpA = try tmp.dir.openDir(io, "A", .{});
1278 defer tmpA.close(io);1278 defer tmpA.close(io);
1279 try tmpA.makeDir(io, "B", .default_dir);1279 try tmpA.createDir(io, "B", .default_dir);
12801280
1281 const testPath = "A" ++ Dir.path.sep_str ++ "B" ++ Dir.path.sep_str ++ "C";1281 const testPath = "A" ++ Dir.path.sep_str ++ "B" ++ Dir.path.sep_str ++ "C";
1282 try tmp.dir.makePath(io, testPath);1282 try tmp.dir.makePath(io, testPath);
...@@ -1290,7 +1290,7 @@ test "makepath through existing valid symlink" {...@@ -1290,7 +1290,7 @@ test "makepath through existing valid symlink" {
1290 var tmp = tmpDir(.{});1290 var tmp = tmpDir(.{});
1291 defer tmp.cleanup();1291 defer tmp.cleanup();
12921292
1293 try tmp.dir.makeDir(io, "realfolder", .default_dir);1293 try tmp.dir.createDir(io, "realfolder", .default_dir);
1294 try setupSymlink(io, tmp.dir, "." ++ Dir.path.sep_str ++ "realfolder", "working-symlink", .{});1294 try setupSymlink(io, tmp.dir, "." ++ Dir.path.sep_str ++ "realfolder", "working-symlink", .{});
12951295
1296 try tmp.dir.makePath(io, "working-symlink" ++ Dir.path.sep_str ++ "in-realfolder");1296 try tmp.dir.makePath(io, "working-symlink" ++ Dir.path.sep_str ++ "in-realfolder");
...@@ -1985,7 +1985,7 @@ test "'.' and '..' in Dir functions" {...@@ -1985,7 +1985,7 @@ test "'.' and '..' in Dir functions" {
1985 const rename_path = try ctx.transformPath("./subdir/../rename");1985 const rename_path = try ctx.transformPath("./subdir/../rename");
1986 const update_path = try ctx.transformPath("./subdir/../update");1986 const update_path = try ctx.transformPath("./subdir/../update");
19871987
1988 try ctx.dir.makeDir(io, subdir_path, .default_dir);1988 try ctx.dir.createDir(io, subdir_path, .default_dir);
1989 try ctx.dir.access(io, subdir_path, .{});1989 try ctx.dir.access(io, subdir_path, .{});
1990 var created_subdir = try ctx.dir.openDir(io, subdir_path, .{});1990 var created_subdir = try ctx.dir.openDir(io, subdir_path, .{});
1991 created_subdir.close(io);1991 created_subdir.close(io);
...@@ -2026,7 +2026,7 @@ test "'.' and '..' in absolute functions" {...@@ -2026,7 +2026,7 @@ test "'.' and '..' in absolute functions" {
2026 const base_path = try tmp.dir.realPathFileAlloc(io, ".", allocator);2026 const base_path = try tmp.dir.realPathFileAlloc(io, ".", allocator);
20272027
2028 const subdir_path = try Dir.path.join(allocator, &.{ base_path, "./subdir" });2028 const subdir_path = try Dir.path.join(allocator, &.{ base_path, "./subdir" });
2029 try Dir.makeDirAbsolute(io, subdir_path, .default_dir);2029 try Dir.createDirAbsolute(io, subdir_path, .default_dir);
2030 try Dir.accessAbsolute(io, subdir_path, .{});2030 try Dir.accessAbsolute(io, subdir_path, .{});
2031 var created_subdir = try Dir.openDirAbsolute(io, subdir_path, .{});2031 var created_subdir = try Dir.openDirAbsolute(io, subdir_path, .{});
2032 created_subdir.close(io);2032 created_subdir.close(io);
...@@ -2062,7 +2062,7 @@ test "chmod" {...@@ -2062,7 +2062,7 @@ test "chmod" {
2062 try file.setPermissions(io, .fromMode(0o644));2062 try file.setPermissions(io, .fromMode(0o644));
2063 try expectEqual(0o644, (try file.stat(io)).permissions.toMode() & 0o7777);2063 try expectEqual(0o644, (try file.stat(io)).permissions.toMode() & 0o7777);
20642064
2065 try tmp.dir.makeDir(io, "test_dir", .default_dir);2065 try tmp.dir.createDir(io, "test_dir", .default_dir);
2066 var dir = try tmp.dir.openDir(io, "test_dir", .{ .iterate = true });2066 var dir = try tmp.dir.openDir(io, "test_dir", .{ .iterate = true });
2067 defer dir.close(io);2067 defer dir.close(io);
20682068
...@@ -2083,7 +2083,7 @@ test "change ownership" {...@@ -2083,7 +2083,7 @@ test "change ownership" {
2083 defer file.close(io);2083 defer file.close(io);
2084 try file.setOwner(io, null, null);2084 try file.setOwner(io, null, null);
20852085
2086 try tmp.dir.makeDir(io, "test_dir", .default_dir);2086 try tmp.dir.createDir(io, "test_dir", .default_dir);
20872087
2088 var dir = try tmp.dir.openDir(io, "test_dir", .{ .iterate = true });2088 var dir = try tmp.dir.openDir(io, "test_dir", .{ .iterate = true });
2089 defer dir.close(io);2089 defer dir.close(io);
...@@ -2107,7 +2107,7 @@ test "invalid UTF-8/WTF-8 paths" {...@@ -2107,7 +2107,7 @@ test "invalid UTF-8/WTF-8 paths" {
21072107
2108 try expectError(expected_err, ctx.dir.createFile(io, invalid_path, .{}));2108 try expectError(expected_err, ctx.dir.createFile(io, invalid_path, .{}));
21092109
2110 try expectError(expected_err, ctx.dir.makeDir(io, invalid_path, .default_dir));2110 try expectError(expected_err, ctx.dir.createDir(io, invalid_path, .default_dir));
21112111
2112 try expectError(expected_err, ctx.dir.makePath(io, invalid_path));2112 try expectError(expected_err, ctx.dir.makePath(io, invalid_path));
2113 try expectError(expected_err, ctx.dir.makeOpenPath(io, invalid_path, .{}));2113 try expectError(expected_err, ctx.dir.makeOpenPath(io, invalid_path, .{}));
...@@ -2150,7 +2150,7 @@ test "invalid UTF-8/WTF-8 paths" {...@@ -2150,7 +2150,7 @@ test "invalid UTF-8/WTF-8 paths" {
2150 if (native_os != .wasi and ctx.path_type != .relative) {2150 if (native_os != .wasi and ctx.path_type != .relative) {
2151 var buf: [Dir.max_path_bytes]u8 = undefined;2151 var buf: [Dir.max_path_bytes]u8 = undefined;
2152 try expectError(expected_err, Dir.copyFileAbsolute(invalid_path, invalid_path, io, .{}));2152 try expectError(expected_err, Dir.copyFileAbsolute(invalid_path, invalid_path, io, .{}));
2153 try expectError(expected_err, Dir.makeDirAbsolute(io, invalid_path, .default_dir));2153 try expectError(expected_err, Dir.createDirAbsolute(io, invalid_path, .default_dir));
2154 try expectError(expected_err, Dir.deleteDirAbsolute(io, invalid_path));2154 try expectError(expected_err, Dir.deleteDirAbsolute(io, invalid_path));
2155 try expectError(expected_err, Dir.renameAbsolute(invalid_path, invalid_path, io));2155 try expectError(expected_err, Dir.renameAbsolute(invalid_path, invalid_path, io));
2156 try expectError(expected_err, Dir.openDirAbsolute(io, invalid_path, .{}));2156 try expectError(expected_err, Dir.openDirAbsolute(io, invalid_path, .{}));
...@@ -2496,7 +2496,7 @@ test "access smoke test" {...@@ -2496,7 +2496,7 @@ test "access smoke test" {
24962496
2497 {2497 {
2498 // Create some directory2498 // Create some directory
2499 try tmp.dir.makeDir(io, "some_dir", .default_dir);2499 try tmp.dir.createDir(io, "some_dir", .default_dir);
2500 }2500 }
25012501
2502 {2502 {
...@@ -2552,7 +2552,7 @@ test "open smoke test" {...@@ -2552,7 +2552,7 @@ test "open smoke test" {
2552 }2552 }
25532553
2554 try expectError(error.NotDir, tmp.dir.openDir(io, "some_file", .{}));2554 try expectError(error.NotDir, tmp.dir.openDir(io, "some_file", .{}));
2555 try tmp.dir.makeDir(io, "some_dir", .default_dir);2555 try tmp.dir.createDir(io, "some_dir", .default_dir);
25562556
2557 {2557 {
2558 const dir = try tmp.dir.openDir(io, "some_dir", .{});2558 const dir = try tmp.dir.openDir(io, "some_dir", .{});
src/Package/Fetch.zig+1-1
...@@ -1458,7 +1458,7 @@ pub fn renameTmpIntoCache(io: Io, cache_dir: Io.Dir, tmp_dir_sub_path: []const u...@@ -1458,7 +1458,7 @@ pub fn renameTmpIntoCache(io: Io, cache_dir: Io.Dir, tmp_dir_sub_path: []const u
1458 cache_dir.rename(tmp_dir_sub_path, cache_dir, dest_dir_sub_path, io) catch |err| switch (err) {1458 cache_dir.rename(tmp_dir_sub_path, cache_dir, dest_dir_sub_path, io) catch |err| switch (err) {
1459 error.FileNotFound => {1459 error.FileNotFound => {
1460 if (handled_missing_dir) return err;1460 if (handled_missing_dir) return err;
1461 cache_dir.makeDir(io, dest_dir_sub_path[0..1], .default_dir) catch |mkd_err| switch (mkd_err) {1461 cache_dir.createDir(io, dest_dir_sub_path[0..1], .default_dir) catch |mkd_err| switch (mkd_err) {
1462 error.PathAlreadyExists => handled_missing_dir = true,1462 error.PathAlreadyExists => handled_missing_dir = true,
1463 else => |e| return e,1463 else => |e| return e,
1464 };1464 };
src/Package/Fetch/git.zig+2-2
...@@ -253,7 +253,7 @@ pub const Repository = struct {...@@ -253,7 +253,7 @@ pub const Repository = struct {
253 while (try tree_iter.next()) |entry| {253 while (try tree_iter.next()) |entry| {
254 switch (entry.type) {254 switch (entry.type) {
255 .directory => {255 .directory => {
256 try dir.makeDir(io, entry.name, .default_dir);256 try dir.createDir(io, entry.name, .default_dir);
257 var subdir = try dir.openDir(io, entry.name, .{});257 var subdir = try dir.openDir(io, entry.name, .{});
258 defer subdir.close(io);258 defer subdir.close(io);
259 const sub_path = try std.fs.path.join(repository.odb.allocator, &.{ current_path, entry.name });259 const sub_path = try std.fs.path.join(repository.odb.allocator, &.{ current_path, entry.name });
...@@ -296,7 +296,7 @@ pub const Repository = struct {...@@ -296,7 +296,7 @@ pub const Repository = struct {
296 .gitlink => {296 .gitlink => {
297 // Consistent with git archive behavior, create the directory but297 // Consistent with git archive behavior, create the directory but
298 // do nothing else298 // do nothing else
299 try dir.makeDir(io, entry.name, .default_dir);299 try dir.createDir(io, entry.name, .default_dir);
300 },300 },
301 }301 }
302 }302 }
test/standalone/windows_spawn/main.zig+1-1
...@@ -84,7 +84,7 @@ pub fn main() anyerror!void {...@@ -84,7 +84,7 @@ pub fn main() anyerror!void {
84 // without extension should succeed (case insensitive)84 // without extension should succeed (case insensitive)
85 try testExec(gpa, "heLLo", "hello from exe\n");85 try testExec(gpa, "heLLo", "hello from exe\n");
8686
87 try tmp.dir.makeDir(io, "something", .default_dir);87 try tmp.dir.createDir(io, "something", .default_dir);
88 try renameExe(tmp.dir, "hello", "something/hello.exe");88 try renameExe(tmp.dir, "hello", "something/hello.exe");
8989
90 const relative_path_no_ext = try std.fs.path.join(gpa, &.{ tmp_relative_path, "something/hello" });90 const relative_path_no_ext = try std.fs.path.join(gpa, &.{ tmp_relative_path, "something/hello" });
test/tests.zig+1-1
...@@ -2137,7 +2137,7 @@ pub fn addCliTests(b: *std.Build) *Step {...@@ -2137,7 +2137,7 @@ pub fn addCliTests(b: *std.Build) *Step {
2137 defer dir.close(io);2137 defer dir.close(io);
2138 dir.writeFile(io, .{ .sub_path = "fmt1.zig", .data = unformatted_code }) catch @panic("unhandled");2138 dir.writeFile(io, .{ .sub_path = "fmt1.zig", .data = unformatted_code }) catch @panic("unhandled");
2139 dir.writeFile(io, .{ .sub_path = "fmt2.zig", .data = unformatted_code }) catch @panic("unhandled");2139 dir.writeFile(io, .{ .sub_path = "fmt2.zig", .data = unformatted_code }) catch @panic("unhandled");
2140 dir.makeDir(io, "subdir", .default_dir) catch @panic("unhandled");2140 dir.createDir(io, "subdir", .default_dir) catch @panic("unhandled");
2141 var subdir = dir.openDir(io, "subdir", .{}) catch @panic("unhandled");2141 var subdir = dir.openDir(io, "subdir", .{}) catch @panic("unhandled");
2142 defer subdir.close(io);2142 defer subdir.close(io);
2143 subdir.writeFile(io, .{ .sub_path = "fmt3.zig", .data = unformatted_code }) catch @panic("unhandled");2143 subdir.writeFile(io, .{ .sub_path = "fmt3.zig", .data = unformatted_code }) catch @panic("unhandled");