diff options
| author | daurnimator <quae@daurnimator.com> | 2020-01-15 18:09:10 +1000 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-03-03 13:25:43 -0500 |
| commit | dfb420e6d779b9b6d60a277401aadba2800e3572 (patch) | |
| tree | 663a095aa58134f8bb1c482c93084793352ce951 /lib/std | |
| parent | 88e27f01c8dbf4bda5726c93d12cc4a1d174989d (diff) | |
| download | zig-dfb420e6d779b9b6d60a277401aadba2800e3572.tar.gz zig-dfb420e6d779b9b6d60a277401aadba2800e3572.zip | |
std: add fs.Dir.makeDir
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/fs.zig | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/std/fs.zig b/lib/std/fs.zig index 769d4b395c..f245ab348d 100644 --- a/lib/std/fs.zig +++ b/lib/std/fs.zig @@ -882,6 +882,14 @@ pub const Dir = struct { } } + pub fn makeDir(self: Dir, sub_path: []const u8) !void { + try os.mkdirat(self.fd, sub_path, default_new_dir_mode); + } + + pub fn makeDirC(self: Dir, sub_path: [*:0]const u8) !void { + try os.mkdiratC(self.fd, sub_path, default_new_dir_mode); + } + /// Deprecated; call `openDirList` directly. pub fn openDir(self: Dir, sub_path: []const u8) OpenError!Dir { return self.openDirList(sub_path); |
