| ... | ... | @@ -49,6 +49,7 @@ pub fn trim_prefix(in: []const u8, prefix: []const u8) []const u8 { |
| 49 | 49 | pub fn does_file_exist(fpath: []const u8) !bool { |
| 50 | 50 | const file = std.fs.cwd().openFile(fpath, .{}) catch |e| switch (e) { |
| 51 | 51 | error.FileNotFound => return false, |
| 52 | error.IsDir => return true, |
| 52 | 53 | else => return e, |
| 53 | 54 | }; |
| 54 | 55 | defer file.close(); |
| ... | ... | @@ -58,6 +59,7 @@ pub fn does_file_exist(fpath: []const u8) !bool { |
| 58 | 59 | pub fn does_folder_exist(fpath: []const u8) !bool { |
| 59 | 60 | const file = std.fs.cwd().openFile(fpath, .{}) catch |e| switch (e) { |
| 60 | 61 | error.FileNotFound => return false, |
| 62 | error.IsDir => return true, |
| 61 | 63 | else => return e, |
| 62 | 64 | }; |
| 63 | 65 | defer file.close(); |