| author | |
| committer | |
| log | 62e3d46287a98e98cbddfb3eb6e966ffc324b280 |
| tree | 50fe194df306e72877c2c1fbbbdc916ac93b2a70 |
| parent | 45143c6f04c84e8a519aa24e4d79e9385b5d5e2f |
10 files changed, 115 insertions(+), 115 deletions(-)
lib/std/Thread.zig+1-1| ... | ... | @@ -250,7 +250,7 @@ pub const GetNameError = error{ |
| 250 | 250 | Unexpected, |
| 251 | 251 | } || posix.PrctlError || posix.ReadError || std.fs.File.OpenError || std.fmt.BufPrintError; |
| 252 | 252 | |
| 253 | /// On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 253 | /// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 254 | 254 | /// On other platforms, the result is an opaque sequence of bytes with no particular encoding. |
| 255 | 255 | pub fn getName(self: Thread, buffer_ptr: *[max_name_len:0]u8) GetNameError!?[]const u8 { |
| 256 | 256 | buffer_ptr[max_name_len] = 0; |
lib/std/fs.zig+18-18| ... | ... | @@ -46,7 +46,7 @@ pub const GetAppDataDirError = @import("fs/get_app_data_dir.zig").GetAppDataDirE |
| 46 | 46 | /// The byte count includes room for a null sentinel byte. |
| 47 | 47 | /// |
| 48 | 48 | /// * On Windows, `[]u8` file paths are encoded as |
| 49 | /// [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 49 | /// [WTF-8](https://wtf-8.codeberg.page/). | |
| 50 | 50 | /// * On WASI, `[]u8` file paths are encoded as valid UTF-8. |
| 51 | 51 | /// * On other platforms, `[]u8` file paths are opaque sequences of bytes with |
| 52 | 52 | /// no particular encoding. |
| ... | ... | @@ -68,7 +68,7 @@ pub const max_path_bytes = switch (native_os) { |
| 68 | 68 | /// operations are likely to fit into a `u8` array of this length, but |
| 69 | 69 | /// (depending on the platform) this assumption may not hold for every configuration. |
| 70 | 70 | /// The byte count does not include a null sentinel byte. |
| 71 | /// On Windows, `[]u8` file name components are encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 71 | /// On Windows, `[]u8` file name components are encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 72 | 72 | /// On WASI, file name components are encoded as valid UTF-8. |
| 73 | 73 | /// On other platforms, `[]u8` components are an opaque sequence of bytes with no particular encoding. |
| 74 | 74 | pub const max_name_bytes = switch (native_os) { |
| ... | ... | @@ -100,7 +100,7 @@ pub const base64_decoder = base64.Base64Decoder.init(base64_alphabet, null); |
| 100 | 100 | /// Same as `Dir.updateFile`, except asserts that both `source_path` and `dest_path` |
| 101 | 101 | /// are absolute. See `Dir.updateFile` for a function that operates on both |
| 102 | 102 | /// absolute and relative paths. |
| 103 | /// On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 103 | /// On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 104 | 104 | /// On WASI, both paths should be encoded as valid UTF-8. |
| 105 | 105 | /// On other platforms, both paths are an opaque sequence of bytes with no particular encoding. |
| 106 | 106 | pub fn updateFileAbsolute( |
| ... | ... | @@ -117,7 +117,7 @@ pub fn updateFileAbsolute( |
| 117 | 117 | /// Same as `Dir.copyFile`, except asserts that both `source_path` and `dest_path` |
| 118 | 118 | /// are absolute. See `Dir.copyFile` for a function that operates on both |
| 119 | 119 | /// absolute and relative paths. |
| 120 | /// On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 120 | /// On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 121 | 121 | /// On WASI, both paths should be encoded as valid UTF-8. |
| 122 | 122 | /// On other platforms, both paths are an opaque sequence of bytes with no particular encoding. |
| 123 | 123 | pub fn copyFileAbsolute( |
| ... | ... | @@ -134,7 +134,7 @@ pub fn copyFileAbsolute( |
| 134 | 134 | /// Create a new directory, based on an absolute path. |
| 135 | 135 | /// Asserts that the path is absolute. See `Dir.makeDir` for a function that operates |
| 136 | 136 | /// on both absolute and relative paths. |
| 137 | /// On Windows, `absolute_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 137 | /// On Windows, `absolute_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 138 | 138 | /// On WASI, `absolute_path` should be encoded as valid UTF-8. |
| 139 | 139 | /// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding. |
| 140 | 140 | pub fn makeDirAbsolute(absolute_path: []const u8) !void { |
| ... | ... | @@ -155,7 +155,7 @@ pub fn makeDirAbsoluteW(absolute_path_w: [*:0]const u16) !void { |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | /// Same as `Dir.deleteDir` except the path is absolute. |
| 158 | /// On Windows, `dir_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 158 | /// On Windows, `dir_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 159 | 159 | /// On WASI, `dir_path` should be encoded as valid UTF-8. |
| 160 | 160 | /// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding. |
| 161 | 161 | pub fn deleteDirAbsolute(dir_path: []const u8) !void { |
| ... | ... | @@ -176,7 +176,7 @@ pub fn deleteDirAbsoluteW(dir_path: [*:0]const u16) !void { |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | /// Same as `Dir.rename` except the paths are absolute. |
| 179 | /// On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 179 | /// On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 180 | 180 | /// On WASI, both paths should be encoded as valid UTF-8. |
| 181 | 181 | /// On other platforms, both paths are an opaque sequence of bytes with no particular encoding. |
| 182 | 182 | pub fn renameAbsolute(old_path: []const u8, new_path: []const u8) !void { |
| ... | ... | @@ -238,7 +238,7 @@ pub fn defaultWasiCwd() std.os.wasi.fd_t { |
| 238 | 238 | /// See `openDirAbsoluteZ` for a function that accepts a null-terminated path. |
| 239 | 239 | /// |
| 240 | 240 | /// Asserts that the path parameter has no null bytes. |
| 241 | /// On Windows, `absolute_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 241 | /// On Windows, `absolute_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 242 | 242 | /// On WASI, `absolute_path` should be encoded as valid UTF-8. |
| 243 | 243 | /// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding. |
| 244 | 244 | pub fn openDirAbsolute(absolute_path: []const u8, flags: Dir.OpenOptions) File.OpenError!Dir { |
| ... | ... | @@ -263,7 +263,7 @@ pub fn openDirAbsoluteW(absolute_path_c: [*:0]const u16, flags: Dir.OpenOptions) |
| 263 | 263 | /// operates on both absolute and relative paths. |
| 264 | 264 | /// Asserts that the path parameter has no null bytes. See `openFileAbsoluteZ` for a function |
| 265 | 265 | /// that accepts a null-terminated path. |
| 266 | /// On Windows, `absolute_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 266 | /// On Windows, `absolute_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 267 | 267 | /// On WASI, `absolute_path` should be encoded as valid UTF-8. |
| 268 | 268 | /// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding. |
| 269 | 269 | pub fn openFileAbsolute(absolute_path: []const u8, flags: File.OpenFlags) File.OpenError!File { |
| ... | ... | @@ -288,7 +288,7 @@ pub fn openFileAbsoluteW(absolute_path_w: []const u16, flags: File.OpenFlags) Fi |
| 288 | 288 | /// For example, instead of testing if a file exists and then opening it, just |
| 289 | 289 | /// open it and handle the error for file not found. |
| 290 | 290 | /// See `accessAbsoluteZ` for a function that accepts a null-terminated path. |
| 291 | /// On Windows, `absolute_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 291 | /// On Windows, `absolute_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 292 | 292 | /// On WASI, `absolute_path` should be encoded as valid UTF-8. |
| 293 | 293 | /// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding. |
| 294 | 294 | pub fn accessAbsolute(absolute_path: []const u8, flags: File.OpenFlags) Dir.AccessError!void { |
| ... | ... | @@ -312,7 +312,7 @@ pub fn accessAbsoluteW(absolute_path: [*:0]const u16, flags: File.OpenFlags) Dir |
| 312 | 312 | /// operates on both absolute and relative paths. |
| 313 | 313 | /// Asserts that the path parameter has no null bytes. See `createFileAbsoluteC` for a function |
| 314 | 314 | /// that accepts a null-terminated path. |
| 315 | /// On Windows, `absolute_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 315 | /// On Windows, `absolute_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 316 | 316 | /// On WASI, `absolute_path` should be encoded as valid UTF-8. |
| 317 | 317 | /// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding. |
| 318 | 318 | pub fn createFileAbsolute(absolute_path: []const u8, flags: File.CreateFlags) File.OpenError!File { |
| ... | ... | @@ -336,7 +336,7 @@ pub fn createFileAbsoluteW(absolute_path_w: [*:0]const u16, flags: File.CreateFl |
| 336 | 336 | /// Asserts that the path is absolute. See `Dir.deleteFile` for a function that |
| 337 | 337 | /// operates on both absolute and relative paths. |
| 338 | 338 | /// Asserts that the path parameter has no null bytes. |
| 339 | /// On Windows, `absolute_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 339 | /// On Windows, `absolute_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 340 | 340 | /// On WASI, `absolute_path` should be encoded as valid UTF-8. |
| 341 | 341 | /// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding. |
| 342 | 342 | pub fn deleteFileAbsolute(absolute_path: []const u8) Dir.DeleteFileError!void { |
| ... | ... | @@ -361,7 +361,7 @@ pub fn deleteFileAbsoluteW(absolute_path_w: [*:0]const u16) Dir.DeleteFileError! |
| 361 | 361 | /// Asserts that the path is absolute. See `Dir.deleteTree` for a function that |
| 362 | 362 | /// operates on both absolute and relative paths. |
| 363 | 363 | /// Asserts that the path parameter has no null bytes. |
| 364 | /// On Windows, `absolute_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 364 | /// On Windows, `absolute_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 365 | 365 | /// On WASI, `absolute_path` should be encoded as valid UTF-8. |
| 366 | 366 | /// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding. |
| 367 | 367 | pub fn deleteTreeAbsolute(absolute_path: []const u8) !void { |
| ... | ... | @@ -379,7 +379,7 @@ pub fn deleteTreeAbsolute(absolute_path: []const u8) !void { |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | /// Same as `Dir.readLink`, except it asserts the path is absolute. |
| 382 | /// On Windows, `pathname` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 382 | /// On Windows, `pathname` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 383 | 383 | /// On WASI, `pathname` should be encoded as valid UTF-8. |
| 384 | 384 | /// On other platforms, `pathname` is an opaque sequence of bytes with no particular encoding. |
| 385 | 385 | pub fn readLinkAbsolute(pathname: []const u8, buffer: *[max_path_bytes]u8) ![]u8 { |
| ... | ... | @@ -405,7 +405,7 @@ pub fn readLinkAbsoluteZ(pathname_c: [*:0]const u8, buffer: *[max_path_bytes]u8) |
| 405 | 405 | /// one; the latter case is known as a dangling link. |
| 406 | 406 | /// If `sym_link_path` exists, it will not be overwritten. |
| 407 | 407 | /// See also `symLinkAbsoluteZ` and `symLinkAbsoluteW`. |
| 408 | /// On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 408 | /// On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 409 | 409 | /// On WASI, both paths should be encoded as valid UTF-8. |
| 410 | 410 | /// On other platforms, both paths are an opaque sequence of bytes with no particular encoding. |
| 411 | 411 | pub fn symLinkAbsolute( |
| ... | ... | @@ -537,7 +537,7 @@ pub fn selfExePathAlloc(allocator: Allocator) ![]u8 { |
| 537 | 537 | /// This function may return an error if the current executable |
| 538 | 538 | /// was deleted after spawning. |
| 539 | 539 | /// Returned value is a slice of out_buffer. |
| 540 | /// On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 540 | /// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 541 | 541 | /// On other platforms, the result is an opaque sequence of bytes with no particular encoding. |
| 542 | 542 | /// |
| 543 | 543 | /// On Linux, depends on procfs being mounted. If the currently executing binary has |
| ... | ... | @@ -677,7 +677,7 @@ pub fn selfExeDirPathAlloc(allocator: Allocator) ![]u8 { |
| 677 | 677 | |
| 678 | 678 | /// Get the directory path that contains the current executable. |
| 679 | 679 | /// Returned value is a slice of out_buffer. |
| 680 | /// On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 680 | /// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 681 | 681 | /// On other platforms, the result is an opaque sequence of bytes with no particular encoding. |
| 682 | 682 | pub fn selfExeDirPath(out_buffer: []u8) SelfExePathError![]const u8 { |
| 683 | 683 | const self_exe_path = try selfExePath(out_buffer); |
| ... | ... | @@ -687,7 +687,7 @@ pub fn selfExeDirPath(out_buffer: []u8) SelfExePathError![]const u8 { |
| 687 | 687 | } |
| 688 | 688 | |
| 689 | 689 | /// `realpath`, except caller must free the returned memory. |
| 690 | /// On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 690 | /// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 691 | 691 | /// On other platforms, the result is an opaque sequence of bytes with no particular encoding. |
| 692 | 692 | /// See also `Dir.realpath`. |
| 693 | 693 | pub fn realpathAlloc(allocator: Allocator, pathname: []const u8) ![]u8 { |
lib/std/fs/Dir.zig+32-32| ... | ... | @@ -855,7 +855,7 @@ pub const OpenError = error{ |
| 855 | 855 | /// WASI-only; file paths must be valid UTF-8. |
| 856 | 856 | InvalidUtf8, |
| 857 | 857 | /// Windows-only; file paths provided by the user must be valid WTF-8. |
| 858 | /// https://simonsapin.github.io/wtf-8/ | |
| 858 | /// https://wtf-8.codeberg.page/ | |
| 859 | 859 | InvalidWtf8, |
| 860 | 860 | BadPathName, |
| 861 | 861 | DeviceBusy, |
| ... | ... | @@ -873,7 +873,7 @@ pub fn close(self: *Dir) void { |
| 873 | 873 | /// To create a new file, see `createFile`. |
| 874 | 874 | /// Call `File.close` to release the resource. |
| 875 | 875 | /// Asserts that the path parameter has no null bytes. |
| 876 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 876 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 877 | 877 | /// On WASI, `sub_path` should be encoded as valid UTF-8. |
| 878 | 878 | /// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding. |
| 879 | 879 | pub fn openFile(self: Dir, sub_path: []const u8, flags: File.OpenFlags) File.OpenError!File { |
| ... | ... | @@ -999,7 +999,7 @@ pub fn openFileZ(self: Dir, sub_path: [*:0]const u8, flags: File.OpenFlags) File |
| 999 | 999 | } |
| 1000 | 1000 | |
| 1001 | 1001 | /// Same as `openFile` but Windows-only and the path parameter is |
| 1002 | /// [WTF-16](https://simonsapin.github.io/wtf-8/#potentially-ill-formed-utf-16) encoded. | |
| 1002 | /// [WTF-16](https://wtf-8.codeberg.page/#potentially-ill-formed-utf-16) encoded. | |
| 1003 | 1003 | pub fn openFileW(self: Dir, sub_path_w: []const u16, flags: File.OpenFlags) File.OpenError!File { |
| 1004 | 1004 | const w = windows; |
| 1005 | 1005 | const file: File = .{ |
| ... | ... | @@ -1038,7 +1038,7 @@ pub fn openFileW(self: Dir, sub_path_w: []const u16, flags: File.OpenFlags) File |
| 1038 | 1038 | /// Creates, opens, or overwrites a file with write access. |
| 1039 | 1039 | /// Call `File.close` on the result when done. |
| 1040 | 1040 | /// Asserts that the path parameter has no null bytes. |
| 1041 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 1041 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 1042 | 1042 | /// On WASI, `sub_path` should be encoded as valid UTF-8. |
| 1043 | 1043 | /// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding. |
| 1044 | 1044 | pub fn createFile(self: Dir, sub_path: []const u8, flags: File.CreateFlags) File.OpenError!File { |
| ... | ... | @@ -1150,7 +1150,7 @@ pub fn createFileZ(self: Dir, sub_path_c: [*:0]const u8, flags: File.CreateFlags |
| 1150 | 1150 | } |
| 1151 | 1151 | |
| 1152 | 1152 | /// Same as `createFile` but Windows-only and the path parameter is |
| 1153 | /// [WTF-16](https://simonsapin.github.io/wtf-8/#potentially-ill-formed-utf-16) encoded. | |
| 1153 | /// [WTF-16](https://wtf-8.codeberg.page/#potentially-ill-formed-utf-16) encoded. | |
| 1154 | 1154 | pub fn createFileW(self: Dir, sub_path_w: []const u16, flags: File.CreateFlags) File.OpenError!File { |
| 1155 | 1155 | const w = windows; |
| 1156 | 1156 | const read_flag = if (flags.read) @as(u32, w.GENERIC_READ) else 0; |
| ... | ... | @@ -1195,7 +1195,7 @@ pub const MakeError = posix.MakeDirError; |
| 1195 | 1195 | /// Creates a single directory with a relative or absolute path. |
| 1196 | 1196 | /// To create multiple directories to make an entire path, see `makePath`. |
| 1197 | 1197 | /// To operate on only absolute paths, see `makeDirAbsolute`. |
| 1198 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 1198 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 1199 | 1199 | /// On WASI, `sub_path` should be encoded as valid UTF-8. |
| 1200 | 1200 | /// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding. |
| 1201 | 1201 | pub fn makeDir(self: Dir, sub_path: []const u8) MakeError!void { |
| ... | ... | @@ -1221,7 +1221,7 @@ pub fn makeDirW(self: Dir, sub_path: [*:0]const u16) MakeError!void { |
| 1221 | 1221 | /// Returns success if the path already exists and is a directory. |
| 1222 | 1222 | /// This function is not atomic, and if it returns an error, the file system may |
| 1223 | 1223 | /// have been modified regardless. |
| 1224 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 1224 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 1225 | 1225 | /// On WASI, `sub_path` should be encoded as valid UTF-8. |
| 1226 | 1226 | /// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding. |
| 1227 | 1227 | /// Fails on an empty path with `error.BadPathName` as that is not a path that can be created. |
| ... | ... | @@ -1275,7 +1275,7 @@ pub fn makePathStatus(self: Dir, sub_path: []const u8) (MakeError || StatFileErr |
| 1275 | 1275 | /// Opens the dir if the path already exists and is a directory. |
| 1276 | 1276 | /// This function is not atomic, and if it returns an error, the file system may |
| 1277 | 1277 | /// have been modified regardless. |
| 1278 | /// `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 1278 | /// `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 1279 | 1279 | fn makeOpenPathAccessMaskW(self: Dir, sub_path: []const u8, access_mask: u32, no_follow: bool) (MakeError || OpenError || StatFileError)!Dir { |
| 1280 | 1280 | const w = windows; |
| 1281 | 1281 | var it = try fs.path.componentIterator(sub_path); |
| ... | ... | @@ -1326,7 +1326,7 @@ fn makeOpenPathAccessMaskW(self: Dir, sub_path: []const u8, access_mask: u32, no |
| 1326 | 1326 | /// This function performs `makePath`, followed by `openDir`. |
| 1327 | 1327 | /// If supported by the OS, this operation is atomic. It is not atomic on |
| 1328 | 1328 | /// all operating systems. |
| 1329 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 1329 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 1330 | 1330 | /// On WASI, `sub_path` should be encoded as valid UTF-8. |
| 1331 | 1331 | /// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding. |
| 1332 | 1332 | pub fn makeOpenPath(self: Dir, sub_path: []const u8, open_dir_options: OpenOptions) (MakeError || OpenError || StatFileError)!Dir { |
| ... | ... | @@ -1357,9 +1357,9 @@ pub const RealPathError = posix.RealPathError; |
| 1357 | 1357 | /// `pathname` relative to this `Dir`. If `pathname` is absolute, ignores this |
| 1358 | 1358 | /// `Dir` handle and returns the canonicalized absolute pathname of `pathname` |
| 1359 | 1359 | /// argument. |
| 1360 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 1360 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 1361 | 1361 | /// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding. |
| 1362 | /// On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 1362 | /// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 1363 | 1363 | /// On other platforms, the result is an opaque sequence of bytes with no particular encoding. |
| 1364 | 1364 | /// This function is not universally supported by all platforms. |
| 1365 | 1365 | /// Currently supported hosts are: Linux, macOS, and Windows. |
| ... | ... | @@ -1429,7 +1429,7 @@ pub fn realpathZ(self: Dir, pathname: [*:0]const u8, out_buffer: []u8) RealPathE |
| 1429 | 1429 | /// Deprecated: use `realpathW2`. |
| 1430 | 1430 | /// |
| 1431 | 1431 | /// Windows-only. Same as `Dir.realpath` except `pathname` is WTF16 LE encoded. |
| 1432 | /// The result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 1432 | /// The result is encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 1433 | 1433 | /// See also `Dir.realpath`, `realpathW`. |
| 1434 | 1434 | pub fn realpathW(self: Dir, pathname: []const u16, out_buffer: []u8) RealPathError![]u8 { |
| 1435 | 1435 | var wide_buf: [std.os.windows.PATH_MAX_WIDE]u16 = undefined; |
| ... | ... | @@ -1529,7 +1529,7 @@ pub const OpenOptions = struct { |
| 1529 | 1529 | /// open until `close` is called on the result. |
| 1530 | 1530 | /// The directory cannot be iterated unless the `iterate` option is set to `true`. |
| 1531 | 1531 | /// |
| 1532 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 1532 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 1533 | 1533 | /// On WASI, `sub_path` should be encoded as valid UTF-8. |
| 1534 | 1534 | /// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding. |
| 1535 | 1535 | /// Asserts that the path parameter has no null bytes. |
| ... | ... | @@ -1744,7 +1744,7 @@ fn makeOpenDirAccessMaskW(self: Dir, sub_path_w: [*:0]const u16, access_mask: u3 |
| 1744 | 1744 | pub const DeleteFileError = posix.UnlinkError; |
| 1745 | 1745 | |
| 1746 | 1746 | /// Delete a file name and possibly the file it refers to, based on an open directory handle. |
| 1747 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 1747 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 1748 | 1748 | /// On WASI, `sub_path` should be encoded as valid UTF-8. |
| 1749 | 1749 | /// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding. |
| 1750 | 1750 | /// Asserts that the path parameter has no null bytes. |
| ... | ... | @@ -1805,7 +1805,7 @@ pub const DeleteDirError = error{ |
| 1805 | 1805 | /// WASI-only; file paths must be valid UTF-8. |
| 1806 | 1806 | InvalidUtf8, |
| 1807 | 1807 | /// Windows-only; file paths provided by the user must be valid WTF-8. |
| 1808 | /// https://simonsapin.github.io/wtf-8/ | |
| 1808 | /// https://wtf-8.codeberg.page/ | |
| 1809 | 1809 | InvalidWtf8, |
| 1810 | 1810 | BadPathName, |
| 1811 | 1811 | /// On Windows, `\\server` or `\\server\share` was not found. |
| ... | ... | @@ -1816,7 +1816,7 @@ pub const DeleteDirError = error{ |
| 1816 | 1816 | |
| 1817 | 1817 | /// Returns `error.DirNotEmpty` if the directory is not empty. |
| 1818 | 1818 | /// To delete a directory recursively, see `deleteTree`. |
| 1819 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 1819 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 1820 | 1820 | /// On WASI, `sub_path` should be encoded as valid UTF-8. |
| 1821 | 1821 | /// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding. |
| 1822 | 1822 | /// Asserts that the path parameter has no null bytes. |
| ... | ... | @@ -1858,7 +1858,7 @@ pub const RenameError = posix.RenameError; |
| 1858 | 1858 | /// If new_sub_path already exists, it will be replaced. |
| 1859 | 1859 | /// Renaming a file over an existing directory or a directory |
| 1860 | 1860 | /// over an existing file will fail with `error.IsDir` or `error.NotDir` |
| 1861 | /// On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 1861 | /// On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 1862 | 1862 | /// On WASI, both paths should be encoded as valid UTF-8. |
| 1863 | 1863 | /// On other platforms, both paths are an opaque sequence of bytes with no particular encoding. |
| 1864 | 1864 | pub fn rename(self: Dir, old_sub_path: []const u8, new_sub_path: []const u8) RenameError!void { |
| ... | ... | @@ -1889,7 +1889,7 @@ pub const SymLinkFlags = struct { |
| 1889 | 1889 | /// A symbolic link (also known as a soft link) may point to an existing file or to a nonexistent |
| 1890 | 1890 | /// one; the latter case is known as a dangling link. |
| 1891 | 1891 | /// If `sym_link_path` exists, it will not be overwritten. |
| 1892 | /// On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 1892 | /// On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 1893 | 1893 | /// On WASI, both paths should be encoded as valid UTF-8. |
| 1894 | 1894 | /// On other platforms, both paths are an opaque sequence of bytes with no particular encoding. |
| 1895 | 1895 | pub fn symLink( |
| ... | ... | @@ -1972,7 +1972,7 @@ pub fn symLinkW( |
| 1972 | 1972 | /// Same as `symLink`, except tries to create the symbolic link until it |
| 1973 | 1973 | /// succeeds or encounters an error other than `error.PathAlreadyExists`. |
| 1974 | 1974 | /// |
| 1975 | /// * On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 1975 | /// * On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 1976 | 1976 | /// * On WASI, both paths should be encoded as valid UTF-8. |
| 1977 | 1977 | /// * On other platforms, both paths are an opaque sequence of bytes with no particular encoding. |
| 1978 | 1978 | pub fn atomicSymLink( |
| ... | ... | @@ -2018,7 +2018,7 @@ pub const ReadLinkError = posix.ReadLinkError; |
| 2018 | 2018 | /// Read value of a symbolic link. |
| 2019 | 2019 | /// The return value is a slice of `buffer`, from index `0`. |
| 2020 | 2020 | /// Asserts that the path parameter has no null bytes. |
| 2021 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 2021 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 2022 | 2022 | /// On WASI, `sub_path` should be encoded as valid UTF-8. |
| 2023 | 2023 | /// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding. |
| 2024 | 2024 | pub fn readLink(self: Dir, sub_path: []const u8, buffer: []u8) ReadLinkError![]u8 { |
| ... | ... | @@ -2058,7 +2058,7 @@ pub fn readLinkW(self: Dir, sub_path_w: []const u16, buffer: []u8) ![]u8 { |
| 2058 | 2058 | /// the situation is ambiguous. It could either mean that the entire file was read, and |
| 2059 | 2059 | /// it exactly fits the buffer, or it could mean the buffer was not big enough for the |
| 2060 | 2060 | /// entire file. |
| 2061 | /// On Windows, `file_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 2061 | /// On Windows, `file_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 2062 | 2062 | /// On WASI, `file_path` should be encoded as valid UTF-8. |
| 2063 | 2063 | /// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding. |
| 2064 | 2064 | pub fn readFile(self: Dir, file_path: []const u8, buffer: []u8) ![]u8 { |
| ... | ... | @@ -2085,7 +2085,7 @@ pub const ReadFileAllocError = File.OpenError || File.ReadError || Allocator.Err |
| 2085 | 2085 | /// `File.Reader` which handles this seamlessly. |
| 2086 | 2086 | pub fn readFileAlloc( |
| 2087 | 2087 | dir: Dir, |
| 2088 | /// On Windows, should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 2088 | /// On Windows, should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 2089 | 2089 | /// On WASI, should be encoded as valid UTF-8. |
| 2090 | 2090 | /// On other platforms, an opaque sequence of bytes with no particular encoding. |
| 2091 | 2091 | sub_path: []const u8, |
| ... | ... | @@ -2104,7 +2104,7 @@ pub fn readFileAlloc( |
| 2104 | 2104 | /// `File.Reader`. |
| 2105 | 2105 | pub fn readFileAllocOptions( |
| 2106 | 2106 | dir: Dir, |
| 2107 | /// On Windows, should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 2107 | /// On Windows, should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 2108 | 2108 | /// On WASI, should be encoded as valid UTF-8. |
| 2109 | 2109 | /// On other platforms, an opaque sequence of bytes with no particular encoding. |
| 2110 | 2110 | sub_path: []const u8, |
| ... | ... | @@ -2148,7 +2148,7 @@ pub const DeleteTreeError = error{ |
| 2148 | 2148 | InvalidUtf8, |
| 2149 | 2149 | |
| 2150 | 2150 | /// Windows-only; file paths provided by the user must be valid WTF-8. |
| 2151 | /// https://simonsapin.github.io/wtf-8/ | |
| 2151 | /// https://wtf-8.codeberg.page/ | |
| 2152 | 2152 | InvalidWtf8, |
| 2153 | 2153 | |
| 2154 | 2154 | /// On Windows, file paths cannot contain these characters: |
| ... | ... | @@ -2163,7 +2163,7 @@ pub const DeleteTreeError = error{ |
| 2163 | 2163 | /// removes it. If it cannot be removed because it is a non-empty directory, |
| 2164 | 2164 | /// this function recursively removes its entries and then tries again. |
| 2165 | 2165 | /// This operation is not atomic on most file systems. |
| 2166 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 2166 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 2167 | 2167 | /// On WASI, `sub_path` should be encoded as valid UTF-8. |
| 2168 | 2168 | /// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding. |
| 2169 | 2169 | pub fn deleteTree(self: Dir, sub_path: []const u8) DeleteTreeError!void { |
| ... | ... | @@ -2370,7 +2370,7 @@ pub fn deleteTree(self: Dir, sub_path: []const u8) DeleteTreeError!void { |
| 2370 | 2370 | |
| 2371 | 2371 | /// Like `deleteTree`, but only keeps one `Iterator` active at a time to minimize the function's stack size. |
| 2372 | 2372 | /// This is slower than `deleteTree` but uses less stack space. |
| 2373 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 2373 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 2374 | 2374 | /// On WASI, `sub_path` should be encoded as valid UTF-8. |
| 2375 | 2375 | /// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding. |
| 2376 | 2376 | pub fn deleteTreeMinStackSize(self: Dir, sub_path: []const u8) DeleteTreeError!void { |
| ... | ... | @@ -2568,7 +2568,7 @@ fn deleteTreeOpenInitialSubpath(self: Dir, sub_path: []const u8, kind_hint: File |
| 2568 | 2568 | pub const WriteFileError = File.WriteError || File.OpenError; |
| 2569 | 2569 | |
| 2570 | 2570 | pub const WriteFileOptions = struct { |
| 2571 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 2571 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 2572 | 2572 | /// On WASI, `sub_path` should be encoded as valid UTF-8. |
| 2573 | 2573 | /// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding. |
| 2574 | 2574 | sub_path: []const u8, |
| ... | ... | @@ -2586,7 +2586,7 @@ pub fn writeFile(self: Dir, options: WriteFileOptions) WriteFileError!void { |
| 2586 | 2586 | pub const AccessError = posix.AccessError; |
| 2587 | 2587 | |
| 2588 | 2588 | /// Test accessing `sub_path`. |
| 2589 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 2589 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 2590 | 2590 | /// On WASI, `sub_path` should be encoded as valid UTF-8. |
| 2591 | 2591 | /// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding. |
| 2592 | 2592 | /// Be careful of Time-Of-Check-Time-Of-Use race conditions when using this function. |
| ... | ... | @@ -2641,7 +2641,7 @@ pub const PrevStatus = enum { |
| 2641 | 2641 | /// atime, and mode of the source file so that the next call to `updateFile` will not need a copy. |
| 2642 | 2642 | /// Returns the previous status of the file before updating. |
| 2643 | 2643 | /// If any of the directories do not exist for dest_path, they are created. |
| 2644 | /// On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 2644 | /// On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 2645 | 2645 | /// On WASI, both paths should be encoded as valid UTF-8. |
| 2646 | 2646 | /// On other platforms, both paths are an opaque sequence of bytes with no particular encoding. |
| 2647 | 2647 | pub fn updateFile( |
| ... | ... | @@ -2713,7 +2713,7 @@ pub const CopyFileError = File.OpenError || File.StatError || |
| 2713 | 2713 | /// dest_path. |
| 2714 | 2714 | /// |
| 2715 | 2715 | /// On Windows, both paths should be encoded as |
| 2716 | /// [WTF-8](https://simonsapin.github.io/wtf-8/). On WASI, both paths should be | |
| 2716 | /// [WTF-8](https://wtf-8.codeberg.page/). On WASI, both paths should be | |
| 2717 | 2717 | /// encoded as valid UTF-8. On other platforms, both paths are an opaque |
| 2718 | 2718 | /// sequence of bytes with no particular encoding. |
| 2719 | 2719 | pub fn copyFile( |
| ... | ... | @@ -2758,7 +2758,7 @@ pub const AtomicFileOptions = struct { |
| 2758 | 2758 | /// Always call `AtomicFile.deinit` to clean up, regardless of whether |
| 2759 | 2759 | /// `AtomicFile.finish` succeeded. `dest_path` must remain valid until |
| 2760 | 2760 | /// `AtomicFile.deinit` is called. |
| 2761 | /// On Windows, `dest_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 2761 | /// On Windows, `dest_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 2762 | 2762 | /// On WASI, `dest_path` should be encoded as valid UTF-8. |
| 2763 | 2763 | /// On other platforms, `dest_path` is an opaque sequence of bytes with no particular encoding. |
| 2764 | 2764 | pub fn atomicFile(self: Dir, dest_path: []const u8, options: AtomicFileOptions) !AtomicFile { |
| ... | ... | @@ -2792,7 +2792,7 @@ pub const StatFileError = File.OpenError || File.StatError || posix.FStatAtError |
| 2792 | 2792 | /// Symlinks are followed. |
| 2793 | 2793 | /// |
| 2794 | 2794 | /// `sub_path` may be absolute, in which case `self` is ignored. |
| 2795 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 2795 | /// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 2796 | 2796 | /// On WASI, `sub_path` should be encoded as valid UTF-8. |
| 2797 | 2797 | /// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding. |
| 2798 | 2798 | pub fn statFile(self: Dir, sub_path: []const u8) StatFileError!Stat { |
lib/std/fs/File.zig+1-1| ... | ... | @@ -60,7 +60,7 @@ pub const OpenError = error{ |
| 60 | 60 | /// WASI-only; file paths must be valid UTF-8. |
| 61 | 61 | InvalidUtf8, |
| 62 | 62 | /// Windows-only; file paths provided by the user must be valid WTF-8. |
| 63 | /// https://simonsapin.github.io/wtf-8/ | |
| 63 | /// https://wtf-8.codeberg.page/ | |
| 64 | 64 | InvalidWtf8, |
| 65 | 65 | /// On Windows, file paths cannot contain these characters: |
| 66 | 66 | /// '/', '*', '?', '"', '<', '>', '|' |
lib/std/fs/path.zig+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | //! |
| 3 | 3 | //! Windows paths are arbitrary sequences of `u16` (WTF-16). |
| 4 | 4 | //! For cross-platform APIs that deal with sequences of `u8`, Windows |
| 5 | //! paths are encoded by Zig as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 5 | //! paths are encoded by Zig as [WTF-8](https://wtf-8.codeberg.page/). | |
| 6 | 6 | //! WTF-8 is a superset of UTF-8 that allows encoding surrogate codepoints, |
| 7 | 7 | //! which enables lossless roundtripping when converting to/from WTF-16 |
| 8 | 8 | //! (as long as the WTF-8 encoded surrogate codepoints do not form a pair). |
lib/std/os.zig+1-1| ... | ... | @@ -98,7 +98,7 @@ pub fn isGetFdPathSupportedOnTarget(os: std.Target.Os) bool { |
| 98 | 98 | /// For example, while it generally works on Linux, macOS, FreeBSD or Windows, it is |
| 99 | 99 | /// unsupported on WASI. |
| 100 | 100 | /// |
| 101 | /// * On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 101 | /// * On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 102 | 102 | /// * On other platforms, the result is an opaque sequence of bytes with no particular encoding. |
| 103 | 103 | /// |
| 104 | 104 | /// Calling this function is usually a bug. |
lib/std/os/windows.zig+4-4| ... | ... | @@ -749,7 +749,7 @@ pub const GetCurrentDirectoryError = error{ |
| 749 | 749 | }; |
| 750 | 750 | |
| 751 | 751 | /// The result is a slice of `buffer`, indexed from 0. |
| 752 | /// The result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 752 | /// The result is encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 753 | 753 | pub fn GetCurrentDirectory(buffer: []u8) GetCurrentDirectoryError![]u8 { |
| 754 | 754 | var wtf16le_buf: [PATH_MAX_WIDE:0]u16 = undefined; |
| 755 | 755 | const result = kernel32.GetCurrentDirectoryW(wtf16le_buf.len + 1, &wtf16le_buf); |
| ... | ... | @@ -976,7 +976,7 @@ pub fn ReadLink(dir: ?HANDLE, sub_path_w: []const u16, out_buffer: []u8) ReadLin |
| 976 | 976 | } |
| 977 | 977 | |
| 978 | 978 | /// Asserts that there is enough space is `out_buffer`. |
| 979 | /// The result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 979 | /// The result is encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 980 | 980 | fn parseReadlinkPath(path: []const u16, is_relative: bool, out_buffer: []u8) []u8 { |
| 981 | 981 | const win32_namespace_path = path: { |
| 982 | 982 | if (is_relative) break :path path; |
| ... | ... | @@ -2416,13 +2416,13 @@ pub const Wtf8ToPrefixedFileWError = error{InvalidWtf8} || Wtf16ToPrefixedFileWE |
| 2416 | 2416 | |
| 2417 | 2417 | /// Same as `sliceToPrefixedFileW` but accepts a pointer |
| 2418 | 2418 | /// to a null-terminated WTF-8 encoded path. |
| 2419 | /// https://simonsapin.github.io/wtf-8/ | |
| 2419 | /// https://wtf-8.codeberg.page/ | |
| 2420 | 2420 | pub fn cStrToPrefixedFileW(dir: ?HANDLE, s: [*:0]const u8) Wtf8ToPrefixedFileWError!PathSpace { |
| 2421 | 2421 | return sliceToPrefixedFileW(dir, mem.sliceTo(s, 0)); |
| 2422 | 2422 | } |
| 2423 | 2423 | |
| 2424 | 2424 | /// Same as `wToPrefixedFileW` but accepts a WTF-8 encoded path. |
| 2425 | /// https://simonsapin.github.io/wtf-8/ | |
| 2425 | /// https://wtf-8.codeberg.page/ | |
| 2426 | 2426 | pub fn sliceToPrefixedFileW(dir: ?HANDLE, path: []const u8) Wtf8ToPrefixedFileWError!PathSpace { |
| 2427 | 2427 | var temp_path: PathSpace = undefined; |
| 2428 | 2428 | temp_path.len = try std.unicode.wtf8ToWtf16Le(&temp_path.data, path); |
lib/std/posix.zig+39-39| ... | ... | @@ -1624,7 +1624,7 @@ pub const OpenError = error{ |
| 1624 | 1624 | InvalidUtf8, |
| 1625 | 1625 | |
| 1626 | 1626 | /// Windows-only; file paths provided by the user must be valid WTF-8. |
| 1627 | /// https://simonsapin.github.io/wtf-8/ | |
| 1627 | /// https://wtf-8.codeberg.page/ | |
| 1628 | 1628 | InvalidWtf8, |
| 1629 | 1629 | |
| 1630 | 1630 | /// On Windows, `\\server` or `\\server\share` was not found. |
| ... | ... | @@ -1647,7 +1647,7 @@ pub const OpenError = error{ |
| 1647 | 1647 | } || UnexpectedError; |
| 1648 | 1648 | |
| 1649 | 1649 | /// Open and possibly create a file. Keeps trying if it gets interrupted. |
| 1650 | /// On Windows, `file_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 1650 | /// On Windows, `file_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 1651 | 1651 | /// On WASI, `file_path` should be encoded as valid UTF-8. |
| 1652 | 1652 | /// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding. |
| 1653 | 1653 | /// See also `openZ`. |
| ... | ... | @@ -1662,7 +1662,7 @@ pub fn open(file_path: []const u8, flags: O, perm: mode_t) OpenError!fd_t { |
| 1662 | 1662 | } |
| 1663 | 1663 | |
| 1664 | 1664 | /// Open and possibly create a file. Keeps trying if it gets interrupted. |
| 1665 | /// On Windows, `file_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 1665 | /// On Windows, `file_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 1666 | 1666 | /// On WASI, `file_path` should be encoded as valid UTF-8. |
| 1667 | 1667 | /// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding. |
| 1668 | 1668 | /// See also `open`. |
| ... | ... | @@ -1710,7 +1710,7 @@ pub fn openZ(file_path: [*:0]const u8, flags: O, perm: mode_t) OpenError!fd_t { |
| 1710 | 1710 | |
| 1711 | 1711 | /// Open and possibly create a file. Keeps trying if it gets interrupted. |
| 1712 | 1712 | /// `file_path` is relative to the open directory handle `dir_fd`. |
| 1713 | /// On Windows, `file_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 1713 | /// On Windows, `file_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 1714 | 1714 | /// On WASI, `file_path` should be encoded as valid UTF-8. |
| 1715 | 1715 | /// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding. |
| 1716 | 1716 | /// See also `openatZ`. |
| ... | ... | @@ -1833,7 +1833,7 @@ fn openOptionsFromFlagsWasi(oflag: O) OpenError!WasiOpenOptions { |
| 1833 | 1833 | |
| 1834 | 1834 | /// Open and possibly create a file. Keeps trying if it gets interrupted. |
| 1835 | 1835 | /// `file_path` is relative to the open directory handle `dir_fd`. |
| 1836 | /// On Windows, `file_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 1836 | /// On Windows, `file_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 1837 | 1837 | /// On WASI, `file_path` should be encoded as valid UTF-8. |
| 1838 | 1838 | /// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding. |
| 1839 | 1839 | /// See also `openat`. |
| ... | ... | @@ -2137,7 +2137,7 @@ pub const SymLinkError = error{ |
| 2137 | 2137 | InvalidUtf8, |
| 2138 | 2138 | |
| 2139 | 2139 | /// Windows-only; file paths provided by the user must be valid WTF-8. |
| 2140 | /// https://simonsapin.github.io/wtf-8/ | |
| 2140 | /// https://wtf-8.codeberg.page/ | |
| 2141 | 2141 | InvalidWtf8, |
| 2142 | 2142 | |
| 2143 | 2143 | BadPathName, |
| ... | ... | @@ -2146,7 +2146,7 @@ pub const SymLinkError = error{ |
| 2146 | 2146 | /// Creates a symbolic link named `sym_link_path` which contains the string `target_path`. |
| 2147 | 2147 | /// A symbolic link (also known as a soft link) may point to an existing file or to a nonexistent |
| 2148 | 2148 | /// one; the latter case is known as a dangling link. |
| 2149 | /// On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 2149 | /// On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 2150 | 2150 | /// On WASI, both paths should be encoded as valid UTF-8. |
| 2151 | 2151 | /// On other platforms, both paths are an opaque sequence of bytes with no particular encoding. |
| 2152 | 2152 | /// If `sym_link_path` exists, it will not be overwritten. |
| ... | ... | @@ -2198,7 +2198,7 @@ pub fn symlinkZ(target_path: [*:0]const u8, sym_link_path: [*:0]const u8) SymLin |
| 2198 | 2198 | /// `target_path` **relative** to `newdirfd` directory handle. |
| 2199 | 2199 | /// A symbolic link (also known as a soft link) may point to an existing file or to a nonexistent |
| 2200 | 2200 | /// one; the latter case is known as a dangling link. |
| 2201 | /// On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 2201 | /// On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 2202 | 2202 | /// On WASI, both paths should be encoded as valid UTF-8. |
| 2203 | 2203 | /// On other platforms, both paths are an opaque sequence of bytes with no particular encoding. |
| 2204 | 2204 | /// If `sym_link_path` exists, it will not be overwritten. |
| ... | ... | @@ -2446,7 +2446,7 @@ pub const UnlinkError = error{ |
| 2446 | 2446 | InvalidUtf8, |
| 2447 | 2447 | |
| 2448 | 2448 | /// Windows-only; file paths provided by the user must be valid WTF-8. |
| 2449 | /// https://simonsapin.github.io/wtf-8/ | |
| 2449 | /// https://wtf-8.codeberg.page/ | |
| 2450 | 2450 | InvalidWtf8, |
| 2451 | 2451 | |
| 2452 | 2452 | /// On Windows, file paths cannot contain these characters: |
| ... | ... | @@ -2458,7 +2458,7 @@ pub const UnlinkError = error{ |
| 2458 | 2458 | } || UnexpectedError; |
| 2459 | 2459 | |
| 2460 | 2460 | /// Delete a name and possibly the file it refers to. |
| 2461 | /// On Windows, `file_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 2461 | /// On Windows, `file_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 2462 | 2462 | /// On WASI, `file_path` should be encoded as valid UTF-8. |
| 2463 | 2463 | /// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding. |
| 2464 | 2464 | /// See also `unlinkZ`. |
| ... | ... | @@ -2522,7 +2522,7 @@ pub const UnlinkatError = UnlinkError || error{ |
| 2522 | 2522 | }; |
| 2523 | 2523 | |
| 2524 | 2524 | /// Delete a file name and possibly the file it refers to, based on an open directory handle. |
| 2525 | /// On Windows, `file_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 2525 | /// On Windows, `file_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 2526 | 2526 | /// On WASI, `file_path` should be encoded as valid UTF-8. |
| 2527 | 2527 | /// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding. |
| 2528 | 2528 | /// Asserts that the path parameter has no null bytes. |
| ... | ... | @@ -2637,7 +2637,7 @@ pub const RenameError = error{ |
| 2637 | 2637 | /// WASI-only; file paths must be valid UTF-8. |
| 2638 | 2638 | InvalidUtf8, |
| 2639 | 2639 | /// Windows-only; file paths provided by the user must be valid WTF-8. |
| 2640 | /// https://simonsapin.github.io/wtf-8/ | |
| 2640 | /// https://wtf-8.codeberg.page/ | |
| 2641 | 2641 | InvalidWtf8, |
| 2642 | 2642 | BadPathName, |
| 2643 | 2643 | NoDevice, |
| ... | ... | @@ -2654,7 +2654,7 @@ pub const RenameError = error{ |
| 2654 | 2654 | } || UnexpectedError; |
| 2655 | 2655 | |
| 2656 | 2656 | /// Change the name or location of a file. |
| 2657 | /// On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 2657 | /// On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 2658 | 2658 | /// On WASI, both paths should be encoded as valid UTF-8. |
| 2659 | 2659 | /// On other platforms, both paths are an opaque sequence of bytes with no particular encoding. |
| 2660 | 2660 | pub fn rename(old_path: []const u8, new_path: []const u8) RenameError!void { |
| ... | ... | @@ -2716,7 +2716,7 @@ pub fn renameW(old_path: [*:0]const u16, new_path: [*:0]const u16) RenameError!v |
| 2716 | 2716 | } |
| 2717 | 2717 | |
| 2718 | 2718 | /// Change the name or location of a file based on an open directory handle. |
| 2719 | /// On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 2719 | /// On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 2720 | 2720 | /// On WASI, both paths should be encoded as valid UTF-8. |
| 2721 | 2721 | /// On other platforms, both paths are an opaque sequence of bytes with no particular encoding. |
| 2722 | 2722 | pub fn renameat( |
| ... | ... | @@ -2824,7 +2824,7 @@ pub fn renameatZ( |
| 2824 | 2824 | } |
| 2825 | 2825 | |
| 2826 | 2826 | /// Same as `renameat` but Windows-only and the path parameters are |
| 2827 | /// [WTF-16](https://simonsapin.github.io/wtf-8/#potentially-ill-formed-utf-16) encoded. | |
| 2827 | /// [WTF-16](https://wtf-8.codeberg.page/#potentially-ill-formed-utf-16) encoded. | |
| 2828 | 2828 | pub fn renameatW( |
| 2829 | 2829 | old_dir_fd: fd_t, |
| 2830 | 2830 | old_path_w: []const u16, |
| ... | ... | @@ -2930,7 +2930,7 @@ pub fn renameatW( |
| 2930 | 2930 | } |
| 2931 | 2931 | } |
| 2932 | 2932 | |
| 2933 | /// On Windows, `sub_dir_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 2933 | /// On Windows, `sub_dir_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 2934 | 2934 | /// On WASI, `sub_dir_path` should be encoded as valid UTF-8. |
| 2935 | 2935 | /// On other platforms, `sub_dir_path` is an opaque sequence of bytes with no particular encoding. |
| 2936 | 2936 | pub fn mkdirat(dir_fd: fd_t, sub_dir_path: []const u8, mode: mode_t) MakeDirError!void { |
| ... | ... | @@ -3040,7 +3040,7 @@ pub const MakeDirError = error{ |
| 3040 | 3040 | /// WASI-only; file paths must be valid UTF-8. |
| 3041 | 3041 | InvalidUtf8, |
| 3042 | 3042 | /// Windows-only; file paths provided by the user must be valid WTF-8. |
| 3043 | /// https://simonsapin.github.io/wtf-8/ | |
| 3043 | /// https://wtf-8.codeberg.page/ | |
| 3044 | 3044 | InvalidWtf8, |
| 3045 | 3045 | BadPathName, |
| 3046 | 3046 | NoDevice, |
| ... | ... | @@ -3050,7 +3050,7 @@ pub const MakeDirError = error{ |
| 3050 | 3050 | |
| 3051 | 3051 | /// Create a directory. |
| 3052 | 3052 | /// `mode` is ignored on Windows and WASI. |
| 3053 | /// On Windows, `dir_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 3053 | /// On Windows, `dir_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 3054 | 3054 | /// On WASI, `dir_path` should be encoded as valid UTF-8. |
| 3055 | 3055 | /// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding. |
| 3056 | 3056 | pub fn mkdir(dir_path: []const u8, mode: mode_t) MakeDirError!void { |
| ... | ... | @@ -3066,7 +3066,7 @@ pub fn mkdir(dir_path: []const u8, mode: mode_t) MakeDirError!void { |
| 3066 | 3066 | } |
| 3067 | 3067 | |
| 3068 | 3068 | /// Same as `mkdir` but the parameter is null-terminated. |
| 3069 | /// On Windows, `dir_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 3069 | /// On Windows, `dir_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 3070 | 3070 | /// On WASI, `dir_path` should be encoded as valid UTF-8. |
| 3071 | 3071 | /// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding. |
| 3072 | 3072 | pub fn mkdirZ(dir_path: [*:0]const u8, mode: mode_t) MakeDirError!void { |
| ... | ... | @@ -3132,7 +3132,7 @@ pub const DeleteDirError = error{ |
| 3132 | 3132 | /// WASI-only; file paths must be valid UTF-8. |
| 3133 | 3133 | InvalidUtf8, |
| 3134 | 3134 | /// Windows-only; file paths provided by the user must be valid WTF-8. |
| 3135 | /// https://simonsapin.github.io/wtf-8/ | |
| 3135 | /// https://wtf-8.codeberg.page/ | |
| 3136 | 3136 | InvalidWtf8, |
| 3137 | 3137 | BadPathName, |
| 3138 | 3138 | /// On Windows, `\\server` or `\\server\share` was not found. |
| ... | ... | @@ -3140,7 +3140,7 @@ pub const DeleteDirError = error{ |
| 3140 | 3140 | } || UnexpectedError; |
| 3141 | 3141 | |
| 3142 | 3142 | /// Deletes an empty directory. |
| 3143 | /// On Windows, `dir_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 3143 | /// On Windows, `dir_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 3144 | 3144 | /// On WASI, `dir_path` should be encoded as valid UTF-8. |
| 3145 | 3145 | /// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding. |
| 3146 | 3146 | pub fn rmdir(dir_path: []const u8) DeleteDirError!void { |
| ... | ... | @@ -3160,7 +3160,7 @@ pub fn rmdir(dir_path: []const u8) DeleteDirError!void { |
| 3160 | 3160 | } |
| 3161 | 3161 | |
| 3162 | 3162 | /// Same as `rmdir` except the parameter is null-terminated. |
| 3163 | /// On Windows, `dir_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 3163 | /// On Windows, `dir_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 3164 | 3164 | /// On WASI, `dir_path` should be encoded as valid UTF-8. |
| 3165 | 3165 | /// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding. |
| 3166 | 3166 | pub fn rmdirZ(dir_path: [*:0]const u8) DeleteDirError!void { |
| ... | ... | @@ -3213,12 +3213,12 @@ pub const ChangeCurDirError = error{ |
| 3213 | 3213 | /// WASI-only; file paths must be valid UTF-8. |
| 3214 | 3214 | InvalidUtf8, |
| 3215 | 3215 | /// Windows-only; file paths provided by the user must be valid WTF-8. |
| 3216 | /// https://simonsapin.github.io/wtf-8/ | |
| 3216 | /// https://wtf-8.codeberg.page/ | |
| 3217 | 3217 | InvalidWtf8, |
| 3218 | 3218 | } || UnexpectedError; |
| 3219 | 3219 | |
| 3220 | 3220 | /// Changes the current working directory of the calling process. |
| 3221 | /// On Windows, `dir_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 3221 | /// On Windows, `dir_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 3222 | 3222 | /// On WASI, `dir_path` should be encoded as valid UTF-8. |
| 3223 | 3223 | /// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding. |
| 3224 | 3224 | pub fn chdir(dir_path: []const u8) ChangeCurDirError!void { |
| ... | ... | @@ -3238,7 +3238,7 @@ pub fn chdir(dir_path: []const u8) ChangeCurDirError!void { |
| 3238 | 3238 | } |
| 3239 | 3239 | |
| 3240 | 3240 | /// Same as `chdir` except the parameter is null-terminated. |
| 3241 | /// On Windows, `dir_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 3241 | /// On Windows, `dir_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 3242 | 3242 | /// On WASI, `dir_path` should be encoded as valid UTF-8. |
| 3243 | 3243 | /// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding. |
| 3244 | 3244 | pub fn chdirZ(dir_path: [*:0]const u8) ChangeCurDirError!void { |
| ... | ... | @@ -3315,7 +3315,7 @@ pub const ReadLinkError = error{ |
| 3315 | 3315 | /// WASI-only; file paths must be valid UTF-8. |
| 3316 | 3316 | InvalidUtf8, |
| 3317 | 3317 | /// Windows-only; file paths provided by the user must be valid WTF-8. |
| 3318 | /// https://simonsapin.github.io/wtf-8/ | |
| 3318 | /// https://wtf-8.codeberg.page/ | |
| 3319 | 3319 | InvalidWtf8, |
| 3320 | 3320 | BadPathName, |
| 3321 | 3321 | /// Windows-only. This error may occur if the opened reparse point is |
| ... | ... | @@ -3326,11 +3326,11 @@ pub const ReadLinkError = error{ |
| 3326 | 3326 | } || UnexpectedError; |
| 3327 | 3327 | |
| 3328 | 3328 | /// Read value of a symbolic link. |
| 3329 | /// On Windows, `file_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 3329 | /// On Windows, `file_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 3330 | 3330 | /// On WASI, `file_path` should be encoded as valid UTF-8. |
| 3331 | 3331 | /// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding. |
| 3332 | 3332 | /// The return value is a slice of `out_buffer` from index 0. |
| 3333 | /// On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 3333 | /// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 3334 | 3334 | /// On WASI, the result is encoded as UTF-8. |
| 3335 | 3335 | /// On other platforms, the result is an opaque sequence of bytes with no particular encoding. |
| 3336 | 3336 | pub fn readlink(file_path: []const u8, out_buffer: []u8) ReadLinkError![]u8 { |
| ... | ... | @@ -3346,7 +3346,7 @@ pub fn readlink(file_path: []const u8, out_buffer: []u8) ReadLinkError![]u8 { |
| 3346 | 3346 | } |
| 3347 | 3347 | |
| 3348 | 3348 | /// Windows-only. Same as `readlink` except `file_path` is WTF16 LE encoded. |
| 3349 | /// The result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 3349 | /// The result is encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 3350 | 3350 | /// See also `readlinkZ`. |
| 3351 | 3351 | pub fn readlinkW(file_path: []const u16, out_buffer: []u8) ReadLinkError![]u8 { |
| 3352 | 3352 | return windows.ReadLink(fs.cwd().fd, file_path, out_buffer); |
| ... | ... | @@ -3381,11 +3381,11 @@ pub fn readlinkZ(file_path: [*:0]const u8, out_buffer: []u8) ReadLinkError![]u8 |
| 3381 | 3381 | } |
| 3382 | 3382 | |
| 3383 | 3383 | /// Similar to `readlink` except reads value of a symbolink link **relative** to `dirfd` directory handle. |
| 3384 | /// On Windows, `file_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 3384 | /// On Windows, `file_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 3385 | 3385 | /// On WASI, `file_path` should be encoded as valid UTF-8. |
| 3386 | 3386 | /// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding. |
| 3387 | 3387 | /// The return value is a slice of `out_buffer` from index 0. |
| 3388 | /// On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 3388 | /// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 3389 | 3389 | /// On WASI, the result is encoded as UTF-8. |
| 3390 | 3390 | /// On other platforms, the result is an opaque sequence of bytes with no particular encoding. |
| 3391 | 3391 | /// See also `readlinkatWasi`, `realinkatZ` and `realinkatW`. |
| ... | ... | @@ -3423,7 +3423,7 @@ pub fn readlinkatWasi(dirfd: fd_t, file_path: []const u8, out_buffer: []u8) Read |
| 3423 | 3423 | } |
| 3424 | 3424 | |
| 3425 | 3425 | /// Windows-only. Same as `readlinkat` except `file_path` is null-terminated, WTF16 LE encoded. |
| 3426 | /// The result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 3426 | /// The result is encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 3427 | 3427 | /// See also `readlinkat`. |
| 3428 | 3428 | pub fn readlinkatW(dirfd: fd_t, file_path: []const u16, out_buffer: []u8) ReadLinkError![]u8 { |
| 3429 | 3429 | return windows.ReadLink(dirfd, file_path, out_buffer); |
| ... | ... | @@ -5058,13 +5058,13 @@ pub const AccessError = error{ |
| 5058 | 5058 | /// WASI-only; file paths must be valid UTF-8. |
| 5059 | 5059 | InvalidUtf8, |
| 5060 | 5060 | /// Windows-only; file paths provided by the user must be valid WTF-8. |
| 5061 | /// https://simonsapin.github.io/wtf-8/ | |
| 5061 | /// https://wtf-8.codeberg.page/ | |
| 5062 | 5062 | InvalidWtf8, |
| 5063 | 5063 | } || UnexpectedError; |
| 5064 | 5064 | |
| 5065 | 5065 | /// check user's permissions for a file |
| 5066 | 5066 | /// |
| 5067 | /// * On Windows, asserts `path` is valid [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 5067 | /// * On Windows, asserts `path` is valid [WTF-8](https://wtf-8.codeberg.page/). | |
| 5068 | 5068 | /// * On WASI, invalid UTF-8 passed to `path` causes `error.InvalidUtf8`. |
| 5069 | 5069 | /// * On other platforms, `path` is an opaque sequence of bytes with no particular encoding. |
| 5070 | 5070 | /// |
| ... | ... | @@ -5115,7 +5115,7 @@ pub fn accessZ(path: [*:0]const u8, mode: u32) AccessError!void { |
| 5115 | 5115 | |
| 5116 | 5116 | /// Check user's permissions for a file, based on an open directory handle. |
| 5117 | 5117 | /// |
| 5118 | /// * On Windows, asserts `path` is valid [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 5118 | /// * On Windows, asserts `path` is valid [WTF-8](https://wtf-8.codeberg.page/). | |
| 5119 | 5119 | /// * On WASI, invalid UTF-8 passed to `path` causes `error.InvalidUtf8`. |
| 5120 | 5120 | /// * On other platforms, `path` is an opaque sequence of bytes with no particular encoding. |
| 5121 | 5121 | /// |
| ... | ... | @@ -5635,7 +5635,7 @@ pub const RealPathError = error{ |
| 5635 | 5635 | PipeBusy, |
| 5636 | 5636 | |
| 5637 | 5637 | /// Windows-only; file paths provided by the user must be valid WTF-8. |
| 5638 | /// https://simonsapin.github.io/wtf-8/ | |
| 5638 | /// https://wtf-8.codeberg.page/ | |
| 5639 | 5639 | InvalidWtf8, |
| 5640 | 5640 | |
| 5641 | 5641 | /// On Windows, `\\server` or `\\server\share` was not found. |
| ... | ... | @@ -5660,7 +5660,7 @@ pub const RealPathError = error{ |
| 5660 | 5660 | /// Expands all symbolic links and resolves references to `.`, `..`, and |
| 5661 | 5661 | /// extra `/` characters in `pathname`. |
| 5662 | 5662 | /// |
| 5663 | /// On Windows, `pathname` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 5663 | /// On Windows, `pathname` should be encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 5664 | 5664 | /// |
| 5665 | 5665 | /// On other platforms, `pathname` is an opaque sequence of bytes with no particular encoding. |
| 5666 | 5666 | /// |
| ... | ... | @@ -5668,7 +5668,7 @@ pub const RealPathError = error{ |
| 5668 | 5668 | /// |
| 5669 | 5669 | /// See also `realpathZ` and `realpathW`. |
| 5670 | 5670 | /// |
| 5671 | /// * On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 5671 | /// * On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 5672 | 5672 | /// * On other platforms, the result is an opaque sequence of bytes with no particular encoding. |
| 5673 | 5673 | /// |
| 5674 | 5674 | /// Calling this function is usually a bug. |
| ... | ... | @@ -5745,7 +5745,7 @@ pub fn realpathZ(pathname: [*:0]const u8, out_buffer: *[max_path_bytes]u8) RealP |
| 5745 | 5745 | /// |
| 5746 | 5746 | /// Same as `realpath` except `pathname` is WTF16LE-encoded. |
| 5747 | 5747 | /// |
| 5748 | /// The result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 5748 | /// The result is encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 5749 | 5749 | /// |
| 5750 | 5750 | /// Calling this function is usually a bug. |
| 5751 | 5751 | pub fn realpathW(pathname: []const u16, out_buffer: *[max_path_bytes]u8) RealPathError![]u8 { |
lib/std/process.zig+17-17| ... | ... | @@ -20,7 +20,7 @@ pub const changeCurDirZ = posix.chdirZ; |
| 20 | 20 | pub const GetCwdError = posix.GetCwdError; |
| 21 | 21 | |
| 22 | 22 | /// The result is a slice of `out_buffer`, from index `0`. |
| 23 | /// On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 23 | /// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 24 | 24 | /// On other platforms, the result is an opaque sequence of bytes with no particular encoding. |
| 25 | 25 | pub fn getCwd(out_buffer: []u8) ![]u8 { |
| 26 | 26 | return posix.getcwd(out_buffer); |
| ... | ... | @@ -29,7 +29,7 @@ pub fn getCwd(out_buffer: []u8) ![]u8 { |
| 29 | 29 | pub const GetCwdAllocError = Allocator.Error || posix.GetCwdError; |
| 30 | 30 | |
| 31 | 31 | /// Caller must free the returned memory. |
| 32 | /// On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 32 | /// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 33 | 33 | /// On other platforms, the result is an opaque sequence of bytes with no particular encoding. |
| 34 | 34 | pub fn getCwdAlloc(allocator: Allocator) ![]u8 { |
| 35 | 35 | // The use of max_path_bytes here is just a heuristic: most paths will fit |
| ... | ... | @@ -139,7 +139,7 @@ pub const EnvMap = struct { |
| 139 | 139 | /// Same as `put` but the key and value become owned by the EnvMap rather |
| 140 | 140 | /// than being copied. |
| 141 | 141 | /// If `putMove` fails, the ownership of key and value does not transfer. |
| 142 | /// On Windows `key` must be a valid [WTF-8](https://simonsapin.github.io/wtf-8/) string. | |
| 142 | /// On Windows `key` must be a valid [WTF-8](https://wtf-8.codeberg.page/) string. | |
| 143 | 143 | pub fn putMove(self: *EnvMap, key: []u8, value: []u8) !void { |
| 144 | 144 | assert(unicode.wtf8ValidateSlice(key)); |
| 145 | 145 | const get_or_put = try self.hash_map.getOrPut(key); |
| ... | ... | @@ -152,7 +152,7 @@ pub const EnvMap = struct { |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | /// `key` and `value` are copied into the EnvMap. |
| 155 | /// On Windows `key` must be a valid [WTF-8](https://simonsapin.github.io/wtf-8/) string. | |
| 155 | /// On Windows `key` must be a valid [WTF-8](https://wtf-8.codeberg.page/) string. | |
| 156 | 156 | pub fn put(self: *EnvMap, key: []const u8, value: []const u8) !void { |
| 157 | 157 | assert(unicode.wtf8ValidateSlice(key)); |
| 158 | 158 | const value_copy = try self.copy(value); |
| ... | ... | @@ -171,7 +171,7 @@ pub const EnvMap = struct { |
| 171 | 171 | |
| 172 | 172 | /// Find the address of the value associated with a key. |
| 173 | 173 | /// The returned pointer is invalidated if the map resizes. |
| 174 | /// On Windows `key` must be a valid [WTF-8](https://simonsapin.github.io/wtf-8/) string. | |
| 174 | /// On Windows `key` must be a valid [WTF-8](https://wtf-8.codeberg.page/) string. | |
| 175 | 175 | pub fn getPtr(self: EnvMap, key: []const u8) ?*[]const u8 { |
| 176 | 176 | assert(unicode.wtf8ValidateSlice(key)); |
| 177 | 177 | return self.hash_map.getPtr(key); |
| ... | ... | @@ -180,7 +180,7 @@ pub const EnvMap = struct { |
| 180 | 180 | /// Return the map's copy of the value associated with |
| 181 | 181 | /// a key. The returned string is invalidated if this |
| 182 | 182 | /// key is removed from the map. |
| 183 | /// On Windows `key` must be a valid [WTF-8](https://simonsapin.github.io/wtf-8/) string. | |
| 183 | /// On Windows `key` must be a valid [WTF-8](https://wtf-8.codeberg.page/) string. | |
| 184 | 184 | pub fn get(self: EnvMap, key: []const u8) ?[]const u8 { |
| 185 | 185 | assert(unicode.wtf8ValidateSlice(key)); |
| 186 | 186 | return self.hash_map.get(key); |
| ... | ... | @@ -188,7 +188,7 @@ pub const EnvMap = struct { |
| 188 | 188 | |
| 189 | 189 | /// Removes the item from the map and frees its value. |
| 190 | 190 | /// This invalidates the value returned by get() for this key. |
| 191 | /// On Windows `key` must be a valid [WTF-8](https://simonsapin.github.io/wtf-8/) string. | |
| 191 | /// On Windows `key` must be a valid [WTF-8](https://wtf-8.codeberg.page/) string. | |
| 192 | 192 | pub fn remove(self: *EnvMap, key: []const u8) void { |
| 193 | 193 | assert(unicode.wtf8ValidateSlice(key)); |
| 194 | 194 | const kv = self.hash_map.fetchRemove(key) orelse return; |
| ... | ... | @@ -387,14 +387,14 @@ pub const GetEnvVarOwnedError = error{ |
| 387 | 387 | EnvironmentVariableNotFound, |
| 388 | 388 | |
| 389 | 389 | /// On Windows, environment variable keys provided by the user must be valid WTF-8. |
| 390 | /// https://simonsapin.github.io/wtf-8/ | |
| 390 | /// https://wtf-8.codeberg.page/ | |
| 391 | 391 | InvalidWtf8, |
| 392 | 392 | }; |
| 393 | 393 | |
| 394 | 394 | /// Caller must free returned memory. |
| 395 | /// On Windows, if `key` is not valid [WTF-8](https://simonsapin.github.io/wtf-8/), | |
| 395 | /// On Windows, if `key` is not valid [WTF-8](https://wtf-8.codeberg.page/), | |
| 396 | 396 | /// then `error.InvalidWtf8` is returned. |
| 397 | /// On Windows, the value is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 397 | /// On Windows, the value is encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 398 | 398 | /// On other platforms, the value is an opaque sequence of bytes with no particular encoding. |
| 399 | 399 | pub fn getEnvVarOwned(allocator: Allocator, key: []const u8) GetEnvVarOwnedError![]u8 { |
| 400 | 400 | if (native_os == .windows) { |
| ... | ... | @@ -469,11 +469,11 @@ pub const HasEnvVarError = error{ |
| 469 | 469 | OutOfMemory, |
| 470 | 470 | |
| 471 | 471 | /// On Windows, environment variable keys provided by the user must be valid WTF-8. |
| 472 | /// https://simonsapin.github.io/wtf-8/ | |
| 472 | /// https://wtf-8.codeberg.page/ | |
| 473 | 473 | InvalidWtf8, |
| 474 | 474 | }; |
| 475 | 475 | |
| 476 | /// On Windows, if `key` is not valid [WTF-8](https://simonsapin.github.io/wtf-8/), | |
| 476 | /// On Windows, if `key` is not valid [WTF-8](https://wtf-8.codeberg.page/), | |
| 477 | 477 | /// then `error.InvalidWtf8` is returned. |
| 478 | 478 | pub fn hasEnvVar(allocator: Allocator, key: []const u8) HasEnvVarError!bool { |
| 479 | 479 | if (native_os == .windows) { |
| ... | ... | @@ -491,7 +491,7 @@ pub fn hasEnvVar(allocator: Allocator, key: []const u8) HasEnvVarError!bool { |
| 491 | 491 | } |
| 492 | 492 | } |
| 493 | 493 | |
| 494 | /// On Windows, if `key` is not valid [WTF-8](https://simonsapin.github.io/wtf-8/), | |
| 494 | /// On Windows, if `key` is not valid [WTF-8](https://wtf-8.codeberg.page/), | |
| 495 | 495 | /// then `error.InvalidWtf8` is returned. |
| 496 | 496 | pub fn hasNonEmptyEnvVar(allocator: Allocator, key: []const u8) HasEnvVarError!bool { |
| 497 | 497 | if (native_os == .windows) { |
| ... | ... | @@ -737,7 +737,7 @@ pub const ArgIteratorWindows = struct { |
| 737 | 737 | |
| 738 | 738 | /// Returns the next argument and advances the iterator. Returns `null` if at the end of the |
| 739 | 739 | /// command-line string. The iterator owns the returned slice. |
| 740 | /// The result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 740 | /// The result is encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 741 | 741 | pub fn next(self: *ArgIteratorWindows) ?[:0]const u8 { |
| 742 | 742 | return self.nextWithStrategy(next_strategy); |
| 743 | 743 | } |
| ... | ... | @@ -771,7 +771,7 @@ pub const ArgIteratorWindows = struct { |
| 771 | 771 | // check to see if we've emitted two consecutive surrogate |
| 772 | 772 | // codepoints that form a valid surrogate pair in order |
| 773 | 773 | // to ensure that we're always emitting well-formed WTF-8 |
| 774 | // (https://simonsapin.github.io/wtf-8/#concatenating). | |
| 774 | // (https://wtf-8.codeberg.page/#concatenating). | |
| 775 | 775 | // |
| 776 | 776 | // If we do have a valid surrogate pair, we need to emit |
| 777 | 777 | // the UTF-8 sequence for the codepoint that they encode |
| ... | ... | @@ -1196,7 +1196,7 @@ pub const ArgIterator = struct { |
| 1196 | 1196 | |
| 1197 | 1197 | /// Get the next argument. Returns 'null' if we are at the end. |
| 1198 | 1198 | /// Returned slice is pointing to the iterator's internal buffer. |
| 1199 | /// On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 1199 | /// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 1200 | 1200 | /// On other platforms, the result is an opaque sequence of bytes with no particular encoding. |
| 1201 | 1201 | pub fn next(self: *ArgIterator) ?([:0]const u8) { |
| 1202 | 1202 | return self.inner.next(); |
| ... | ... | @@ -1234,7 +1234,7 @@ pub fn argsWithAllocator(allocator: Allocator) ArgIterator.InitError!ArgIterator |
| 1234 | 1234 | } |
| 1235 | 1235 | |
| 1236 | 1236 | /// Caller must call argsFree on result. |
| 1237 | /// On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/). | |
| 1237 | /// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/). | |
| 1238 | 1238 | /// On other platforms, the result is an opaque sequence of bytes with no particular encoding. |
| 1239 | 1239 | pub fn argsAlloc(allocator: Allocator) ![][:0]u8 { |
| 1240 | 1240 | // TODO refactor to only make 1 allocation. |
lib/std/process/Child.zig+1-1| ... | ... | @@ -162,7 +162,7 @@ pub const SpawnError = error{ |
| 162 | 162 | NoDevice, |
| 163 | 163 | |
| 164 | 164 | /// Windows-only. `cwd` or `argv` was provided and it was invalid WTF-8. |
| 165 | /// https://simonsapin.github.io/wtf-8/ | |
| 165 | /// https://wtf-8.codeberg.page/ | |
| 166 | 166 | InvalidWtf8, |
| 167 | 167 | |
| 168 | 168 | /// Windows-only. `cwd` was provided, but the path did not exist when spawning the child process. |