authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-08-02 19:36:49+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2020-08-02 19:36:49+02:00
log4b0ab0c1864677d0c50b2a8e12a708a6640d1734
treec4063c5a8ded6dfbb82b604c5e8181c38350c8e9
parentf6ae2505d999305e1b5618fca9d928d96d9299af
signature Signed by PGP key 4AEE18F83AFDEB23

Apply suggestions from code review

Co-authored-by: Andrew Kelley <andrew@ziglang.org>

1 files changed, 5 insertions(+), 5 deletions(-)

lib/std/os.zig+5-5
......@@ -2233,7 +2233,7 @@ pub fn mkdirZ(dir_path: [*:0]const u8, mode: u32) MakeDirError!void {
22332233 }
22342234}
22352235
2236/// Windows-only. Same as `mkdir` but the parameters is null-terminated, WTF16 encoded.
2236/// Windows-only. Same as `mkdir` but the parameters is WTF16 encoded.
22372237pub fn mkdirW(dir_path_w: []const u16, mode: u32) MakeDirError!void {
22382238 const sub_dir_handle = windows.OpenFile(dir_path_w, .{
22392239 .dir = std.fs.cwd().fd,
......@@ -2304,7 +2304,7 @@ pub fn rmdirZ(dir_path: [*:0]const u8) DeleteDirError!void {
23042304 }
23052305}
23062306
2307/// Windows-only. Same as `rmdir` except the parameter is null-terminated, WTF16 encoded.
2307/// Windows-only. Same as `rmdir` except the parameter is WTF16 encoded.
23082308pub fn rmdirW(dir_path_w: []const u16) DeleteDirError!void {
23092309 return windows.DeleteFile(dir_path_w, .{ .dir = std.fs.cwd().fd, .remove_dir = true }) catch |err| switch (err) {
23102310 error.IsDir => unreachable,
......@@ -2411,7 +2411,7 @@ pub fn readlink(file_path: []const u8, out_buffer: []u8) ReadLinkError![]u8 {
24112411
24122412pub const readlinkC = @compileError("deprecated: renamed to readlinkZ");
24132413
2414/// Windows-only. Same as `readlink` except `file_path` is null-terminated, WTF16 encoded.
2414/// Windows-only. Same as `readlink` except `file_path` is WTF16 encoded.
24152415/// See also `readlinkZ`.
24162416pub fn readlinkW(file_path: []const u16, out_buffer: []u8) ReadLinkError![]u8 {
24172417 return windows.ReadLink(std.fs.cwd().fd, file_path, out_buffer);
......@@ -4059,8 +4059,8 @@ pub fn realpathZ(pathname: [*:0]const u8, out_buffer: *[MAX_PATH_BYTES]u8) RealP
40594059 return mem.spanZ(result_path);
40604060}
40614061
4062/// Same as `realpath` except `pathname` is null-terminated and UTF16LE-encoded.
4063/// TODO use ntdll for better semantics
4062/// Same as `realpath` except `pathname` is UTF16LE-encoded.
4063/// TODO use ntdll to emulate `GetFinalPathNameByHandleW` routine
40644064pub fn realpathW(pathname: []const u16, out_buffer: *[MAX_PATH_BYTES]u8) RealPathError![]u8 {
40654065 const w = windows;
40664066