authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-12-28 22:17:39 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-12-28 22:17:39 -08:00
logc6cc82e302b6829b10eaa9b21495bc776e1c73d3
treeec3ef84d3d59d210975fd43e29d58fddf5016ad1
parent4b6221922db6e8c9f252a816abc2cd75374304d6

Dir: add makeDir


1 files changed, 5 insertions(+), 0 deletions(-)

Dir.zig+5
...@@ -53,3 +53,8 @@ pub fn readFileAlloc(self: Dir, allocator: std.mem.Allocator, file_path: [:0]con...@@ -53,3 +53,8 @@ pub fn readFileAlloc(self: Dir, allocator: std.mem.Allocator, file_path: [:0]con
53 const stat_size = std.math.cast(usize, try file.getEndPos()) orelse return error.FileTooBig;53 const stat_size = std.math.cast(usize, try file.getEndPos()) orelse return error.FileTooBig;
54 return file.readToEndAlloc(allocator, max_bytes, stat_size);54 return file.readToEndAlloc(allocator, max_bytes, stat_size);
55}55}
56
57pub fn makeDir(self: Dir, sub_path: [:0]const u8) !void {
58 if (os == .linux)
59 try sys_linux.mkdirat(@intFromEnum(self.fd), sub_path, 0o755);
60}