| ... | @@ -2875,7 +2875,7 @@ pub fn renameatW( | ... | @@ -2875,7 +2875,7 @@ pub fn renameatW( |
| 2875 | /// On Windows, `sub_dir_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | 2875 | /// On Windows, `sub_dir_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). |
| 2876 | /// On WASI, `sub_dir_path` should be encoded as valid UTF-8. | 2876 | /// On WASI, `sub_dir_path` should be encoded as valid UTF-8. |
| 2877 | /// On other platforms, `sub_dir_path` is an opaque sequence of bytes with no particular encoding. | 2877 | /// On other platforms, `sub_dir_path` is an opaque sequence of bytes with no particular encoding. |
| 2878 | pub fn mkdirat(dir_fd: fd_t, sub_dir_path: []const u8, mode: u32) MakeDirError!void { | 2878 | pub fn mkdirat(dir_fd: fd_t, sub_dir_path: []const u8, mode: mode_t) MakeDirError!void { |
| 2879 | if (native_os == .windows) { | 2879 | if (native_os == .windows) { |
| 2880 | const sub_dir_path_w = try windows.sliceToPrefixedFileW(dir_fd, sub_dir_path); | 2880 | const sub_dir_path_w = try windows.sliceToPrefixedFileW(dir_fd, sub_dir_path); |
| 2881 | return mkdiratW(dir_fd, sub_dir_path_w.span(), mode); | 2881 | return mkdiratW(dir_fd, sub_dir_path_w.span(), mode); |
| ... | @@ -2887,7 +2887,7 @@ pub fn mkdirat(dir_fd: fd_t, sub_dir_path: []const u8, mode: u32) MakeDirError!v | ... | @@ -2887,7 +2887,7 @@ pub fn mkdirat(dir_fd: fd_t, sub_dir_path: []const u8, mode: u32) MakeDirError!v |
| 2887 | } | 2887 | } |
| 2888 | } | 2888 | } |
| 2889 | | 2889 | |
| 2890 | pub fn mkdiratWasi(dir_fd: fd_t, sub_dir_path: []const u8, mode: u32) MakeDirError!void { | 2890 | pub fn mkdiratWasi(dir_fd: fd_t, sub_dir_path: []const u8, mode: mode_t) MakeDirError!void { |
| 2891 | _ = mode; | 2891 | _ = mode; |
| 2892 | switch (wasi.path_create_directory(dir_fd, sub_dir_path.ptr, sub_dir_path.len)) { | 2892 | switch (wasi.path_create_directory(dir_fd, sub_dir_path.ptr, sub_dir_path.len)) { |
| 2893 | .SUCCESS => return, | 2893 | .SUCCESS => return, |
| ... | @@ -2912,7 +2912,7 @@ pub fn mkdiratWasi(dir_fd: fd_t, sub_dir_path: []const u8, mode: u32) MakeDirErr | ... | @@ -2912,7 +2912,7 @@ pub fn mkdiratWasi(dir_fd: fd_t, sub_dir_path: []const u8, mode: u32) MakeDirErr |
| 2912 | } | 2912 | } |
| 2913 | | 2913 | |
| 2914 | /// Same as `mkdirat` except the parameters are null-terminated. | 2914 | /// Same as `mkdirat` except the parameters are null-terminated. |
| 2915 | pub fn mkdiratZ(dir_fd: fd_t, sub_dir_path: [*:0]const u8, mode: u32) MakeDirError!void { | 2915 | pub fn mkdiratZ(dir_fd: fd_t, sub_dir_path: [*:0]const u8, mode: mode_t) MakeDirError!void { |
| 2916 | if (native_os == .windows) { | 2916 | if (native_os == .windows) { |
| 2917 | const sub_dir_path_w = try windows.cStrToPrefixedFileW(dir_fd, sub_dir_path); | 2917 | const sub_dir_path_w = try windows.cStrToPrefixedFileW(dir_fd, sub_dir_path); |
| 2918 | return mkdiratW(dir_fd, sub_dir_path_w.span(), mode); | 2918 | return mkdiratW(dir_fd, sub_dir_path_w.span(), mode); |
| ... | @@ -2946,7 +2946,7 @@ pub fn mkdiratZ(dir_fd: fd_t, sub_dir_path: [*:0]const u8, mode: u32) MakeDirErr | ... | @@ -2946,7 +2946,7 @@ pub fn mkdiratZ(dir_fd: fd_t, sub_dir_path: [*:0]const u8, mode: u32) MakeDirErr |
| 2946 | } | 2946 | } |
| 2947 | | 2947 | |
| 2948 | /// Windows-only. Same as `mkdirat` except the parameter WTF16 LE encoded. | 2948 | /// Windows-only. Same as `mkdirat` except the parameter WTF16 LE encoded. |
| 2949 | pub fn mkdiratW(dir_fd: fd_t, sub_path_w: []const u16, mode: u32) MakeDirError!void { | 2949 | pub fn mkdiratW(dir_fd: fd_t, sub_path_w: []const u16, mode: mode_t) MakeDirError!void { |
| 2950 | _ = mode; | 2950 | _ = mode; |
| 2951 | const sub_dir_handle = windows.OpenFile(sub_path_w, .{ | 2951 | const sub_dir_handle = windows.OpenFile(sub_path_w, .{ |
| 2952 | .dir = dir_fd, | 2952 | .dir = dir_fd, |
| ... | @@ -2994,7 +2994,7 @@ pub const MakeDirError = error{ | ... | @@ -2994,7 +2994,7 @@ pub const MakeDirError = error{ |
| 2994 | /// On Windows, `dir_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | 2994 | /// On Windows, `dir_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). |
| 2995 | /// On WASI, `dir_path` should be encoded as valid UTF-8. | 2995 | /// On WASI, `dir_path` should be encoded as valid UTF-8. |
| 2996 | /// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding. | 2996 | /// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding. |
| 2997 | pub fn mkdir(dir_path: []const u8, mode: u32) MakeDirError!void { | 2997 | pub fn mkdir(dir_path: []const u8, mode: mode_t) MakeDirError!void { |
| 2998 | if (native_os == .wasi and !builtin.link_libc) { | 2998 | if (native_os == .wasi and !builtin.link_libc) { |
| 2999 | return mkdirat(wasi.AT.FDCWD, dir_path, mode); | 2999 | return mkdirat(wasi.AT.FDCWD, dir_path, mode); |
| 3000 | } else if (native_os == .windows) { | 3000 | } else if (native_os == .windows) { |
| ... | @@ -3010,7 +3010,7 @@ pub fn mkdir(dir_path: []const u8, mode: u32) MakeDirError!void { | ... | @@ -3010,7 +3010,7 @@ pub fn mkdir(dir_path: []const u8, mode: u32) MakeDirError!void { |
| 3010 | /// On Windows, `dir_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | 3010 | /// On Windows, `dir_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). |
| 3011 | /// On WASI, `dir_path` should be encoded as valid UTF-8. | 3011 | /// On WASI, `dir_path` should be encoded as valid UTF-8. |
| 3012 | /// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding. | 3012 | /// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding. |
| 3013 | pub fn mkdirZ(dir_path: [*:0]const u8, mode: u32) MakeDirError!void { | 3013 | pub fn mkdirZ(dir_path: [*:0]const u8, mode: mode_t) MakeDirError!void { |
| 3014 | if (native_os == .windows) { | 3014 | if (native_os == .windows) { |
| 3015 | const dir_path_w = try windows.cStrToPrefixedFileW(null, dir_path); | 3015 | const dir_path_w = try windows.cStrToPrefixedFileW(null, dir_path); |
| 3016 | return mkdirW(dir_path_w.span(), mode); | 3016 | return mkdirW(dir_path_w.span(), mode); |
| ... | @@ -3041,7 +3041,7 @@ pub fn mkdirZ(dir_path: [*:0]const u8, mode: u32) MakeDirError!void { | ... | @@ -3041,7 +3041,7 @@ pub fn mkdirZ(dir_path: [*:0]const u8, mode: u32) MakeDirError!void { |
| 3041 | } | 3041 | } |
| 3042 | | 3042 | |
| 3043 | /// Windows-only. Same as `mkdir` but the parameters is WTF16LE encoded. | 3043 | /// Windows-only. Same as `mkdir` but the parameters is WTF16LE encoded. |
| 3044 | pub fn mkdirW(dir_path_w: []const u16, mode: u32) MakeDirError!void { | 3044 | pub fn mkdirW(dir_path_w: []const u16, mode: mode_t) MakeDirError!void { |
| 3045 | _ = mode; | 3045 | _ = mode; |
| 3046 | const sub_dir_handle = windows.OpenFile(dir_path_w, .{ | 3046 | const sub_dir_handle = windows.OpenFile(dir_path_w, .{ |
| 3047 | .dir = fs.cwd().fd, | 3047 | .dir = fs.cwd().fd, |