zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit dfb420e6d779b9b6d60a277401aadba2800e3572 (tree)
parent 88e27f01c8dbf4bda5726c93d12cc4a1d174989d
Author: daurnimator <quae@daurnimator.com>
Date:   Wed, 15 Jan 2020 18:09:10 +1000

std: add fs.Dir.makeDir

Diffstat:
Mlib/std/fs.zig | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git 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);