| ... | @@ -160,7 +160,7 @@ pub fn makeDirAbsoluteZ(absolute_path_z: [*:0]const u8) !void { | ... | @@ -160,7 +160,7 @@ pub fn makeDirAbsoluteZ(absolute_path_z: [*:0]const u8) !void { |
| 160 | /// Same as `makeDirAbsolute` except the parameter is a null-terminated WTF-16 LE-encoded string. | 160 | /// Same as `makeDirAbsolute` except the parameter is a null-terminated WTF-16 LE-encoded string. |
| 161 | pub fn makeDirAbsoluteW(absolute_path_w: [*:0]const u16) !void { | 161 | pub fn makeDirAbsoluteW(absolute_path_w: [*:0]const u16) !void { |
| 162 | assert(path.isAbsoluteWindowsW(absolute_path_w)); | 162 | assert(path.isAbsoluteWindowsW(absolute_path_w)); |
| 163 | return posix.mkdirW(absolute_path_w, Dir.default_mode); | 163 | return posix.mkdirW(mem.span(absolute_path_w), Dir.default_mode); |
| 164 | } | 164 | } |
| 165 | | 165 | |
| 166 | /// Same as `Dir.deleteDir` except the path is absolute. | 166 | /// Same as `Dir.deleteDir` except the path is absolute. |
| ... | @@ -181,7 +181,7 @@ pub fn deleteDirAbsoluteZ(dir_path: [*:0]const u8) !void { | ... | @@ -181,7 +181,7 @@ pub fn deleteDirAbsoluteZ(dir_path: [*:0]const u8) !void { |
| 181 | /// Same as `deleteDirAbsolute` except the path parameter is WTF-16 and target OS is assumed Windows. | 181 | /// Same as `deleteDirAbsolute` except the path parameter is WTF-16 and target OS is assumed Windows. |
| 182 | pub fn deleteDirAbsoluteW(dir_path: [*:0]const u16) !void { | 182 | pub fn deleteDirAbsoluteW(dir_path: [*:0]const u16) !void { |
| 183 | assert(path.isAbsoluteWindowsW(dir_path)); | 183 | assert(path.isAbsoluteWindowsW(dir_path)); |
| 184 | return posix.rmdirW(dir_path); | 184 | return posix.rmdirW(mem.span(dir_path)); |
| 185 | } | 185 | } |
| 186 | | 186 | |
| 187 | /// Same as `Dir.rename` except the paths are absolute. | 187 | /// Same as `Dir.rename` except the paths are absolute. |
| ... | @@ -221,7 +221,7 @@ pub fn renameZ(old_dir: Dir, old_sub_path_z: [*:0]const u8, new_dir: Dir, new_su | ... | @@ -221,7 +221,7 @@ pub fn renameZ(old_dir: Dir, old_sub_path_z: [*:0]const u8, new_dir: Dir, new_su |
| 221 | /// Same as `rename` except the parameters are WTF16LE, NT prefixed. | 221 | /// Same as `rename` except the parameters are WTF16LE, NT prefixed. |
| 222 | /// This function is Windows-only. | 222 | /// This function is Windows-only. |
| 223 | pub fn renameW(old_dir: Dir, old_sub_path_w: []const u16, new_dir: Dir, new_sub_path_w: []const u16) !void { | 223 | pub fn renameW(old_dir: Dir, old_sub_path_w: []const u16, new_dir: Dir, new_sub_path_w: []const u16) !void { |
| 224 | return posix.renameatW(old_dir.fd, old_sub_path_w, new_dir.fd, new_sub_path_w); | 224 | return posix.renameatW(old_dir.fd, old_sub_path_w, new_dir.fd, new_sub_path_w, windows.TRUE); |
| 225 | } | 225 | } |
| 226 | | 226 | |
| 227 | /// Returns a handle to the current working directory. It is not opened with iteration capability. | 227 | /// Returns a handle to the current working directory. It is not opened with iteration capability. |
| ... | @@ -338,7 +338,7 @@ pub fn createFileAbsoluteZ(absolute_path_c: [*:0]const u8, flags: File.CreateFla | ... | @@ -338,7 +338,7 @@ pub fn createFileAbsoluteZ(absolute_path_c: [*:0]const u8, flags: File.CreateFla |
| 338 | /// Same as `createFileAbsolute` but the path parameter is WTF-16 encoded. | 338 | /// Same as `createFileAbsolute` but the path parameter is WTF-16 encoded. |
| 339 | pub fn createFileAbsoluteW(absolute_path_w: [*:0]const u16, flags: File.CreateFlags) File.OpenError!File { | 339 | pub fn createFileAbsoluteW(absolute_path_w: [*:0]const u16, flags: File.CreateFlags) File.OpenError!File { |
| 340 | assert(path.isAbsoluteWindowsW(absolute_path_w)); | 340 | assert(path.isAbsoluteWindowsW(absolute_path_w)); |
| 341 | return cwd().createFileW(absolute_path_w, flags); | 341 | return cwd().createFileW(mem.span(absolute_path_w), flags); |
| 342 | } | 342 | } |
| 343 | | 343 | |
| 344 | /// Delete a file name and possibly the file it refers to, based on an absolute path. | 344 | /// Delete a file name and possibly the file it refers to, based on an absolute path. |
| ... | @@ -362,7 +362,7 @@ pub fn deleteFileAbsoluteZ(absolute_path_c: [*:0]const u8) Dir.DeleteFileError!v | ... | @@ -362,7 +362,7 @@ pub fn deleteFileAbsoluteZ(absolute_path_c: [*:0]const u8) Dir.DeleteFileError!v |
| 362 | /// Same as `deleteFileAbsolute` except the parameter is WTF-16 encoded. | 362 | /// Same as `deleteFileAbsolute` except the parameter is WTF-16 encoded. |
| 363 | pub fn deleteFileAbsoluteW(absolute_path_w: [*:0]const u16) Dir.DeleteFileError!void { | 363 | pub fn deleteFileAbsoluteW(absolute_path_w: [*:0]const u16) Dir.DeleteFileError!void { |
| 364 | assert(path.isAbsoluteWindowsW(absolute_path_w)); | 364 | assert(path.isAbsoluteWindowsW(absolute_path_w)); |
| 365 | return cwd().deleteFileW(absolute_path_w); | 365 | return cwd().deleteFileW(mem.span(absolute_path_w)); |
| 366 | } | 366 | } |
| 367 | | 367 | |
| 368 | /// Removes a symlink, file, or directory. | 368 | /// Removes a symlink, file, or directory. |
| ... | @@ -400,7 +400,7 @@ pub fn readLinkAbsolute(pathname: []const u8, buffer: *[max_path_bytes]u8) ![]u8 | ... | @@ -400,7 +400,7 @@ pub fn readLinkAbsolute(pathname: []const u8, buffer: *[max_path_bytes]u8) ![]u8 |
| 400 | /// encoded. | 400 | /// encoded. |
| 401 | pub fn readlinkAbsoluteW(pathname_w: [*:0]const u16, buffer: *[max_path_bytes]u8) ![]u8 { | 401 | pub fn readlinkAbsoluteW(pathname_w: [*:0]const u16, buffer: *[max_path_bytes]u8) ![]u8 { |
| 402 | assert(path.isAbsoluteWindowsW(pathname_w)); | 402 | assert(path.isAbsoluteWindowsW(pathname_w)); |
| 403 | return posix.readlinkW(pathname_w, buffer); | 403 | return posix.readlinkW(mem.span(pathname_w), buffer); |
| 404 | } | 404 | } |
| 405 | | 405 | |
| 406 | /// Same as `readLink`, except the path parameter is null-terminated. | 406 | /// Same as `readLink`, except the path parameter is null-terminated. |
| ... | @@ -437,13 +437,13 @@ pub fn symLinkAbsolute( | ... | @@ -437,13 +437,13 @@ pub fn symLinkAbsolute( |
| 437 | /// like to create a symbolic link to a directory, specify this with `SymLinkFlags{ .is_directory = true }`. | 437 | /// like to create a symbolic link to a directory, specify this with `SymLinkFlags{ .is_directory = true }`. |
| 438 | /// See also `symLinkAbsolute`, `symLinkAbsoluteZ`. | 438 | /// See also `symLinkAbsolute`, `symLinkAbsoluteZ`. |
| 439 | pub fn symLinkAbsoluteW( | 439 | pub fn symLinkAbsoluteW( |
| 440 | target_path_w: []const u16, | 440 | target_path_w: [*:0]const u16, |
| 441 | sym_link_path_w: []const u16, | 441 | sym_link_path_w: [*:0]const u16, |
| 442 | flags: Dir.SymLinkFlags, | 442 | flags: Dir.SymLinkFlags, |
| 443 | ) !void { | 443 | ) !void { |
| 444 | assert(path.isAbsoluteWindowsWTF16(target_path_w)); | 444 | assert(path.isAbsoluteWindowsW(target_path_w)); |
| 445 | assert(path.isAbsoluteWindowsWTF16(sym_link_path_w)); | 445 | assert(path.isAbsoluteWindowsW(sym_link_path_w)); |
| 446 | return windows.CreateSymbolicLink(null, sym_link_path_w, target_path_w, flags.is_directory); | 446 | return windows.CreateSymbolicLink(null, mem.span(sym_link_path_w), mem.span(target_path_w), flags.is_directory); |
| 447 | } | 447 | } |
| 448 | | 448 | |
| 449 | /// Same as `symLinkAbsolute` except the parameters are null-terminated pointers. | 449 | /// Same as `symLinkAbsolute` except the parameters are null-terminated pointers. |