| ... | @@ -706,7 +706,6 @@ pub const Dir = struct { | ... | @@ -706,7 +706,6 @@ pub const Dir = struct { |
| 706 | /// Call `File.close` to release the resource. | 706 | /// Call `File.close` to release the resource. |
| 707 | /// Asserts that the path parameter has no null bytes. | 707 | /// Asserts that the path parameter has no null bytes. |
| 708 | pub fn openFile(self: Dir, sub_path: []const u8, flags: File.OpenFlags) File.OpenError!File { | 708 | pub fn openFile(self: Dir, sub_path: []const u8, flags: File.OpenFlags) File.OpenError!File { |
| 709 | if (std.debug.runtime_safety) for (sub_path) |byte| assert(byte != 0); | | |
| 710 | if (builtin.os.tag == .windows) { | 709 | if (builtin.os.tag == .windows) { |
| 711 | const path_w = try os.windows.sliceToPrefixedFileW(sub_path); | 710 | const path_w = try os.windows.sliceToPrefixedFileW(sub_path); |
| 712 | return self.openFileW(&path_w, flags); | 711 | return self.openFileW(&path_w, flags); |
| ... | @@ -756,7 +755,6 @@ pub const Dir = struct { | ... | @@ -756,7 +755,6 @@ pub const Dir = struct { |
| 756 | /// Call `File.close` on the result when done. | 755 | /// Call `File.close` on the result when done. |
| 757 | /// Asserts that the path parameter has no null bytes. | 756 | /// Asserts that the path parameter has no null bytes. |
| 758 | pub fn createFile(self: Dir, sub_path: []const u8, flags: File.CreateFlags) File.OpenError!File { | 757 | pub fn createFile(self: Dir, sub_path: []const u8, flags: File.CreateFlags) File.OpenError!File { |
| 759 | if (std.debug.runtime_safety) for (sub_path) |byte| assert(byte != 0); | | |
| 760 | if (builtin.os.tag == .windows) { | 758 | if (builtin.os.tag == .windows) { |
| 761 | const path_w = try os.windows.sliceToPrefixedFileW(sub_path); | 759 | const path_w = try os.windows.sliceToPrefixedFileW(sub_path); |
| 762 | return self.createFileW(&path_w, flags); | 760 | return self.createFileW(&path_w, flags); |
| ... | @@ -909,7 +907,6 @@ pub const Dir = struct { | ... | @@ -909,7 +907,6 @@ pub const Dir = struct { |
| 909 | /// | 907 | /// |
| 910 | /// Asserts that the path parameter has no null bytes. | 908 | /// Asserts that the path parameter has no null bytes. |
| 911 | pub fn openDirTraverse(self: Dir, sub_path: []const u8) OpenError!Dir { | 909 | pub fn openDirTraverse(self: Dir, sub_path: []const u8) OpenError!Dir { |
| 912 | if (std.debug.runtime_safety) for (sub_path) |byte| assert(byte != 0); | | |
| 913 | if (builtin.os.tag == .windows) { | 910 | if (builtin.os.tag == .windows) { |
| 914 | const sub_path_w = try os.windows.sliceToPrefixedFileW(sub_path); | 911 | const sub_path_w = try os.windows.sliceToPrefixedFileW(sub_path); |
| 915 | return self.openDirTraverseW(&sub_path_w); | 912 | return self.openDirTraverseW(&sub_path_w); |
| ... | @@ -927,7 +924,6 @@ pub const Dir = struct { | ... | @@ -927,7 +924,6 @@ pub const Dir = struct { |
| 927 | /// | 924 | /// |
| 928 | /// Asserts that the path parameter has no null bytes. | 925 | /// Asserts that the path parameter has no null bytes. |
| 929 | pub fn openDirList(self: Dir, sub_path: []const u8) OpenError!Dir { | 926 | pub fn openDirList(self: Dir, sub_path: []const u8) OpenError!Dir { |
| 930 | if (std.debug.runtime_safety) for (sub_path) |byte| assert(byte != 0); | | |
| 931 | if (builtin.os.tag == .windows) { | 927 | if (builtin.os.tag == .windows) { |
| 932 | const sub_path_w = try os.windows.sliceToPrefixedFileW(sub_path); | 928 | const sub_path_w = try os.windows.sliceToPrefixedFileW(sub_path); |
| 933 | return self.openDirListW(&sub_path_w); | 929 | return self.openDirListW(&sub_path_w); |
| ... | @@ -1091,7 +1087,6 @@ pub const Dir = struct { | ... | @@ -1091,7 +1087,6 @@ pub const Dir = struct { |
| 1091 | /// To delete a directory recursively, see `deleteTree`. | 1087 | /// To delete a directory recursively, see `deleteTree`. |
| 1092 | /// Asserts that the path parameter has no null bytes. | 1088 | /// Asserts that the path parameter has no null bytes. |
| 1093 | pub fn deleteDir(self: Dir, sub_path: []const u8) DeleteDirError!void { | 1089 | pub fn deleteDir(self: Dir, sub_path: []const u8) DeleteDirError!void { |
| 1094 | if (std.debug.runtime_safety) for (sub_path) |byte| assert(byte != 0); | | |
| 1095 | if (builtin.os.tag == .windows) { | 1090 | if (builtin.os.tag == .windows) { |
| 1096 | const sub_path_w = try os.windows.sliceToPrefixedFileW(sub_path); | 1091 | const sub_path_w = try os.windows.sliceToPrefixedFileW(sub_path); |
| 1097 | return self.deleteDirW(&sub_path_w); | 1092 | return self.deleteDirW(&sub_path_w); |
| ... | @@ -1121,7 +1116,6 @@ pub const Dir = struct { | ... | @@ -1121,7 +1116,6 @@ pub const Dir = struct { |
| 1121 | /// The return value is a slice of `buffer`, from index `0`. | 1116 | /// The return value is a slice of `buffer`, from index `0`. |
| 1122 | /// Asserts that the path parameter has no null bytes. | 1117 | /// Asserts that the path parameter has no null bytes. |
| 1123 | pub fn readLink(self: Dir, sub_path: []const u8, buffer: *[MAX_PATH_BYTES]u8) ![]u8 { | 1118 | pub fn readLink(self: Dir, sub_path: []const u8, buffer: *[MAX_PATH_BYTES]u8) ![]u8 { |
| 1124 | if (std.debug.runtime_safety) for (sub_path) |byte| assert(byte != 0); | | |
| 1125 | const sub_path_c = try os.toPosixPath(sub_path); | 1119 | const sub_path_c = try os.toPosixPath(sub_path); |
| 1126 | return self.readLinkC(&sub_path_c, buffer); | 1120 | return self.readLinkC(&sub_path_c, buffer); |
| 1127 | } | 1121 | } |