| author | |
| committer | |
| log | b31c8f71fa44e38c842898c85c37d495cd9a5e1c |
| tree | aa38aea648e2809accb6cf36729659982375dad1 |
| parent | fc99d96ee5bccb61b06c94470ae0ef5f930e0df2 |
1 files changed, 10 insertions(+), 0 deletions(-)
Dir.zig+10| ... | ... | @@ -94,3 +94,13 @@ pub fn makePath(self: Dir, sub_path: [:0]const u8) !void { |
| 94 | 94 | component = it.next() orelse return; |
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | ||
| 98 | pub fn makeOpenPath(self: Dir, sub_path: [:0]const u8, flags: OpenDirFlags) !Dir { | |
| 99 | return self.openDir(sub_path, flags) catch |err| switch (err) { | |
| 100 | error.ENOENT => { | |
| 101 | try self.makePath(sub_path); | |
| 102 | return self.openDir(sub_path, flags); | |
| 103 | }, | |
| 104 | else => |e| return e, | |
| 105 | }; | |
| 106 | } |