@@ -160,7 +160,7 @@ pub fn makeDirAbsoluteZ(absolute_path_z: [*:0]const u8) !void {
160160/// Same as `makeDirAbsolute` except the parameter is a null-terminated WTF-16 LE-encoded string.
161161pub fn makeDirAbsoluteW (absolute_path_w : [* :0 ]const u16 ) ! void {
162162 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 );
164164}
165165
166166/// Same as `Dir.deleteDir` except the path is absolute.
@@ -181,7 +181,7 @@ pub fn deleteDirAbsoluteZ(dir_path: [*:0]const u8) !void {
181181/// Same as `deleteDirAbsolute` except the path parameter is WTF-16 and target OS is assumed Windows.
182182pub fn deleteDirAbsoluteW (dir_path : [* :0 ]const u16 ) ! void {
183183 assert (path .isAbsoluteWindowsW (dir_path ));
184- return posix .rmdirW (dir_path );
184+ return posix .rmdirW (mem . span ( dir_path ) );
185185}
186186
187187/// 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
221221/// Same as `rename` except the parameters are WTF16LE, NT prefixed.
222222/// This function is Windows-only.
223223pub 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 );
225225}
226226
227227/// 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
338338/// Same as `createFileAbsolute` but the path parameter is WTF-16 encoded.
339339pub fn createFileAbsoluteW (absolute_path_w : [* :0 ]const u16 , flags : File.CreateFlags ) File.OpenError ! File {
340340 assert (path .isAbsoluteWindowsW (absolute_path_w ));
341- return cwd ().createFileW (absolute_path_w , flags );
341+ return cwd ().createFileW (mem . span ( absolute_path_w ) , flags );
342342}
343343
344344/// 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
362362/// Same as `deleteFileAbsolute` except the parameter is WTF-16 encoded.
363363pub fn deleteFileAbsoluteW (absolute_path_w : [* :0 ]const u16 ) Dir.DeleteFileError ! void {
364364 assert (path .isAbsoluteWindowsW (absolute_path_w ));
365- return cwd ().deleteFileW (absolute_path_w );
365+ return cwd ().deleteFileW (mem . span ( absolute_path_w ) );
366366}
367367
368368/// Removes a symlink, file, or directory.
@@ -400,7 +400,7 @@ pub fn readLinkAbsolute(pathname: []const u8, buffer: *[max_path_bytes]u8) ![]u8
400400/// encoded.
401401pub fn readlinkAbsoluteW (pathname_w : [* :0 ]const u16 , buffer : * [max_path_bytes ]u8 ) ! []u8 {
402402 assert (path .isAbsoluteWindowsW (pathname_w ));
403- return posix .readlinkW (pathname_w , buffer );
403+ return posix .readlinkW (mem . span ( pathname_w ) , buffer );
404404}
405405
406406/// Same as `readLink`, except the path parameter is null-terminated.
@@ -437,13 +437,13 @@ pub fn symLinkAbsolute(
437437/// like to create a symbolic link to a directory, specify this with `SymLinkFlags{ .is_directory = true }`.
438438/// See also `symLinkAbsolute`, `symLinkAbsoluteZ`.
439439pub fn symLinkAbsoluteW (
440- target_path_w : []const u16 ,
441- sym_link_path_w : []const u16 ,
440+ target_path_w : [* : 0 ]const u16 ,
441+ sym_link_path_w : [* : 0 ]const u16 ,
442442 flags : Dir.SymLinkFlags ,
443443) ! void {
444- assert (path .isAbsoluteWindowsWTF16 (target_path_w ));
445- assert (path .isAbsoluteWindowsWTF16 (sym_link_path_w ));
446- return windows .CreateSymbolicLink (null , sym_link_path_w , target_path_w , flags .is_directory );
444+ assert (path .isAbsoluteWindowsW (target_path_w ));
445+ assert (path .isAbsoluteWindowsW (sym_link_path_w ));
446+ return windows .CreateSymbolicLink (null , mem . span ( sym_link_path_w ), mem . span ( target_path_w ) , flags .is_directory );
447447}
448448
449449/// Same as `symLinkAbsolute` except the parameters are null-terminated pointers.
0 commit comments