| ... | ... | @@ -734,7 +734,7 @@ pub fn atomicSymLink(allocator: *Allocator, existing_path: []const u8, new_path: |
| 734 | 734 | } |
| 735 | 735 | } |
| 736 | 736 | |
| 737 | | pub const DeleteFileError = error { |
| 737 | pub const DeleteFileError = error{ |
| 738 | 738 | FileNotFound, |
| 739 | 739 | AccessDenied, |
| 740 | 740 | FileBusy, |
| ... | ... | @@ -1035,7 +1035,7 @@ pub fn makePath(allocator: *Allocator, full_path: []const u8) !void { |
| 1035 | 1035 | } |
| 1036 | 1036 | } |
| 1037 | 1037 | |
| 1038 | | pub const DeleteDirError = error { |
| 1038 | pub const DeleteDirError = error{ |
| 1039 | 1039 | AccessDenied, |
| 1040 | 1040 | FileBusy, |
| 1041 | 1041 | SymLinkLoop, |
| ... | ... | @@ -1090,7 +1090,6 @@ pub fn deleteDir(allocator: *Allocator, dir_path: []const u8) DeleteDirError!voi |
| 1090 | 1090 | }, |
| 1091 | 1091 | else => @compileError("unimplemented"), |
| 1092 | 1092 | } |
| 1093 | | |
| 1094 | 1093 | } |
| 1095 | 1094 | |
| 1096 | 1095 | /// Whether ::full_path describes a symlink, file, or directory, this function |
| ... | ... | @@ -1227,7 +1226,7 @@ pub const Dir = struct { |
| 1227 | 1226 | }; |
| 1228 | 1227 | }; |
| 1229 | 1228 | |
| 1230 | | pub const OpenError = error { |
| 1229 | pub const OpenError = error{ |
| 1231 | 1230 | PathNotFound, |
| 1232 | 1231 | NotDir, |
| 1233 | 1232 | AccessDenied, |
| ... | ... | @@ -1253,13 +1252,13 @@ pub const Dir = struct { |
| 1253 | 1252 | Os.windows => blk: { |
| 1254 | 1253 | var find_file_data: windows.WIN32_FIND_DATAA = undefined; |
| 1255 | 1254 | const handle = try windows_util.windowsFindFirstFile(allocator, dir_path, &find_file_data); |
| 1256 | | break :blk Handle { |
| 1255 | break :blk Handle{ |
| 1257 | 1256 | .handle = handle, |
| 1258 | 1257 | .find_file_data = find_file_data, // TODO guaranteed copy elision |
| 1259 | 1258 | .first = true, |
| 1260 | 1259 | }; |
| 1261 | 1260 | }, |
| 1262 | | Os.macosx, Os.ios => Handle { |
| 1261 | Os.macosx, Os.ios => Handle{ |
| 1263 | 1262 | .fd = try posixOpen( |
| 1264 | 1263 | allocator, |
| 1265 | 1264 | dir_path, |
| ... | ... | @@ -1271,8 +1270,13 @@ pub const Dir = struct { |
| 1271 | 1270 | .end_index = 0, |
| 1272 | 1271 | .buf = []u8{}, |
| 1273 | 1272 | }, |
| 1274 | | Os.linux => Handle { |
| 1275 | | .fd = try posixOpen(allocator, dir_path, posix.O_RDONLY | posix.O_DIRECTORY | posix.O_CLOEXEC, 0,), |
| 1273 | Os.linux => Handle{ |
| 1274 | .fd = try posixOpen( |
| 1275 | allocator, |
| 1276 | dir_path, |
| 1277 | posix.O_RDONLY | posix.O_DIRECTORY | posix.O_CLOEXEC, |
| 1278 | 0, |
| 1279 | ), |
| 1276 | 1280 | .index = 0, |
| 1277 | 1281 | .end_index = 0, |
| 1278 | 1282 | .buf = []u8{}, |
| ... | ... | @@ -1378,7 +1382,7 @@ pub const Dir = struct { |
| 1378 | 1382 | if (attrs & windows.FILE_ATTRIBUTE_NORMAL != 0) break :blk Entry.Kind.File; |
| 1379 | 1383 | break :blk Entry.Kind.Unknown; |
| 1380 | 1384 | }; |
| 1381 | | return Entry { |
| 1385 | return Entry{ |
| 1382 | 1386 | .name = name, |
| 1383 | 1387 | .kind = kind, |
| 1384 | 1388 | }; |