authorgravatar for marko03kostic@protonmail.comusebeforefree <marko03kostic@protonmail.com> 2025-10-10 17:18:34+00:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-10 23:53:00+02:00
log62e3d46287a98e98cbddfb3eb6e966ffc324b280
tree50fe194df306e72877c2c1fbbbdc916ac93b2a70
parent45143c6f04c84e8a519aa24e4d79e9385b5d5e2f

replaced https://simonsapin.github.io/wtf-8/ with https://wtf-8.codeberg.page/


10 files changed, 115 insertions(+), 115 deletions(-)

lib/std/Thread.zig+1-1
...@@ -250,7 +250,7 @@ pub const GetNameError = error{...@@ -250,7 +250,7 @@ pub const GetNameError = error{
250 Unexpected,250 Unexpected,
251} || posix.PrctlError || posix.ReadError || std.fs.File.OpenError || std.fmt.BufPrintError;251} || posix.PrctlError || posix.ReadError || std.fs.File.OpenError || std.fmt.BufPrintError;
252252
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/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.254/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
255pub fn getName(self: Thread, buffer_ptr: *[max_name_len:0]u8) GetNameError!?[]const u8 {255pub fn getName(self: Thread, buffer_ptr: *[max_name_len:0]u8) GetNameError!?[]const u8 {
256 buffer_ptr[max_name_len] = 0;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,7 +46,7 @@ pub const GetAppDataDirError = @import("fs/get_app_data_dir.zig").GetAppDataDirE
46/// The byte count includes room for a null sentinel byte.46/// The byte count includes room for a null sentinel byte.
47///47///
48/// * On Windows, `[]u8` file paths are encoded as48/// * 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/// * On WASI, `[]u8` file paths are encoded as valid UTF-8.50/// * On WASI, `[]u8` file paths are encoded as valid UTF-8.
51/// * On other platforms, `[]u8` file paths are opaque sequences of bytes with51/// * On other platforms, `[]u8` file paths are opaque sequences of bytes with
52/// no particular encoding.52/// no particular encoding.
...@@ -68,7 +68,7 @@ pub const max_path_bytes = switch (native_os) {...@@ -68,7 +68,7 @@ pub const max_path_bytes = switch (native_os) {
68/// operations are likely to fit into a `u8` array of this length, but68/// operations are likely to fit into a `u8` array of this length, but
69/// (depending on the platform) this assumption may not hold for every configuration.69/// (depending on the platform) this assumption may not hold for every configuration.
70/// The byte count does not include a null sentinel byte.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/// On WASI, file name components are encoded as valid UTF-8.72/// On WASI, file name components are encoded as valid UTF-8.
73/// On other platforms, `[]u8` components are an opaque sequence of bytes with no particular encoding.73/// On other platforms, `[]u8` components are an opaque sequence of bytes with no particular encoding.
74pub const max_name_bytes = switch (native_os) {74pub const max_name_bytes = switch (native_os) {
...@@ -100,7 +100,7 @@ pub const base64_decoder = base64.Base64Decoder.init(base64_alphabet, null);...@@ -100,7 +100,7 @@ pub const base64_decoder = base64.Base64Decoder.init(base64_alphabet, null);
100/// Same as `Dir.updateFile`, except asserts that both `source_path` and `dest_path`100/// Same as `Dir.updateFile`, except asserts that both `source_path` and `dest_path`
101/// are absolute. See `Dir.updateFile` for a function that operates on both101/// are absolute. See `Dir.updateFile` for a function that operates on both
102/// absolute and relative paths.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/// On WASI, both paths should be encoded as valid UTF-8.104/// On WASI, both paths should be encoded as valid UTF-8.
105/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.105/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
106pub fn updateFileAbsolute(106pub fn updateFileAbsolute(
...@@ -117,7 +117,7 @@ pub fn updateFileAbsolute(...@@ -117,7 +117,7 @@ pub fn updateFileAbsolute(
117/// Same as `Dir.copyFile`, except asserts that both `source_path` and `dest_path`117/// Same as `Dir.copyFile`, except asserts that both `source_path` and `dest_path`
118/// are absolute. See `Dir.copyFile` for a function that operates on both118/// are absolute. See `Dir.copyFile` for a function that operates on both
119/// absolute and relative paths.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/// On WASI, both paths should be encoded as valid UTF-8.121/// On WASI, both paths should be encoded as valid UTF-8.
122/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.122/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
123pub fn copyFileAbsolute(123pub fn copyFileAbsolute(
...@@ -134,7 +134,7 @@ pub fn copyFileAbsolute(...@@ -134,7 +134,7 @@ pub fn copyFileAbsolute(
134/// Create a new directory, based on an absolute path.134/// Create a new directory, based on an absolute path.
135/// Asserts that the path is absolute. See `Dir.makeDir` for a function that operates135/// Asserts that the path is absolute. See `Dir.makeDir` for a function that operates
136/// on both absolute and relative paths.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/// On WASI, `absolute_path` should be encoded as valid UTF-8.138/// On WASI, `absolute_path` should be encoded as valid UTF-8.
139/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding.139/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding.
140pub fn makeDirAbsolute(absolute_path: []const u8) !void {140pub fn makeDirAbsolute(absolute_path: []const u8) !void {
...@@ -155,7 +155,7 @@ pub fn makeDirAbsoluteW(absolute_path_w: [*:0]const u16) !void {...@@ -155,7 +155,7 @@ pub fn makeDirAbsoluteW(absolute_path_w: [*:0]const u16) !void {
155}155}
156156
157/// Same as `Dir.deleteDir` except the path is absolute.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/// On WASI, `dir_path` should be encoded as valid UTF-8.159/// On WASI, `dir_path` should be encoded as valid UTF-8.
160/// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding.160/// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding.
161pub fn deleteDirAbsolute(dir_path: []const u8) !void {161pub fn deleteDirAbsolute(dir_path: []const u8) !void {
...@@ -176,7 +176,7 @@ pub fn deleteDirAbsoluteW(dir_path: [*:0]const u16) !void {...@@ -176,7 +176,7 @@ pub fn deleteDirAbsoluteW(dir_path: [*:0]const u16) !void {
176}176}
177177
178/// Same as `Dir.rename` except the paths are absolute.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/// On WASI, both paths should be encoded as valid UTF-8.180/// On WASI, both paths should be encoded as valid UTF-8.
181/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.181/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
182pub fn renameAbsolute(old_path: []const u8, new_path: []const u8) !void {182pub fn renameAbsolute(old_path: []const u8, new_path: []const u8) !void {
...@@ -238,7 +238,7 @@ pub fn defaultWasiCwd() std.os.wasi.fd_t {...@@ -238,7 +238,7 @@ pub fn defaultWasiCwd() std.os.wasi.fd_t {
238/// See `openDirAbsoluteZ` for a function that accepts a null-terminated path.238/// See `openDirAbsoluteZ` for a function that accepts a null-terminated path.
239///239///
240/// Asserts that the path parameter has no null bytes.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/// On WASI, `absolute_path` should be encoded as valid UTF-8.242/// On WASI, `absolute_path` should be encoded as valid UTF-8.
243/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding.243/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding.
244pub fn openDirAbsolute(absolute_path: []const u8, flags: Dir.OpenOptions) File.OpenError!Dir {244pub 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,7 +263,7 @@ pub fn openDirAbsoluteW(absolute_path_c: [*:0]const u16, flags: Dir.OpenOptions)
263/// operates on both absolute and relative paths.263/// operates on both absolute and relative paths.
264/// Asserts that the path parameter has no null bytes. See `openFileAbsoluteZ` for a function264/// Asserts that the path parameter has no null bytes. See `openFileAbsoluteZ` for a function
265/// that accepts a null-terminated path.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/// On WASI, `absolute_path` should be encoded as valid UTF-8.267/// On WASI, `absolute_path` should be encoded as valid UTF-8.
268/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding.268/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding.
269pub fn openFileAbsolute(absolute_path: []const u8, flags: File.OpenFlags) File.OpenError!File {269pub 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,7 +288,7 @@ pub fn openFileAbsoluteW(absolute_path_w: []const u16, flags: File.OpenFlags) Fi
288/// For example, instead of testing if a file exists and then opening it, just288/// For example, instead of testing if a file exists and then opening it, just
289/// open it and handle the error for file not found.289/// open it and handle the error for file not found.
290/// See `accessAbsoluteZ` for a function that accepts a null-terminated path.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/// On WASI, `absolute_path` should be encoded as valid UTF-8.292/// On WASI, `absolute_path` should be encoded as valid UTF-8.
293/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding.293/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding.
294pub fn accessAbsolute(absolute_path: []const u8, flags: File.OpenFlags) Dir.AccessError!void {294pub 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,7 +312,7 @@ pub fn accessAbsoluteW(absolute_path: [*:0]const u16, flags: File.OpenFlags) Dir
312/// operates on both absolute and relative paths.312/// operates on both absolute and relative paths.
313/// Asserts that the path parameter has no null bytes. See `createFileAbsoluteC` for a function313/// Asserts that the path parameter has no null bytes. See `createFileAbsoluteC` for a function
314/// that accepts a null-terminated path.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/// On WASI, `absolute_path` should be encoded as valid UTF-8.316/// On WASI, `absolute_path` should be encoded as valid UTF-8.
317/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding.317/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding.
318pub fn createFileAbsolute(absolute_path: []const u8, flags: File.CreateFlags) File.OpenError!File {318pub 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,7 +336,7 @@ pub fn createFileAbsoluteW(absolute_path_w: [*:0]const u16, flags: File.CreateFl
336/// Asserts that the path is absolute. See `Dir.deleteFile` for a function that336/// Asserts that the path is absolute. See `Dir.deleteFile` for a function that
337/// operates on both absolute and relative paths.337/// operates on both absolute and relative paths.
338/// Asserts that the path parameter has no null bytes.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/// On WASI, `absolute_path` should be encoded as valid UTF-8.340/// On WASI, `absolute_path` should be encoded as valid UTF-8.
341/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding.341/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding.
342pub fn deleteFileAbsolute(absolute_path: []const u8) Dir.DeleteFileError!void {342pub 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,7 +361,7 @@ pub fn deleteFileAbsoluteW(absolute_path_w: [*:0]const u16) Dir.DeleteFileError!
361/// Asserts that the path is absolute. See `Dir.deleteTree` for a function that361/// Asserts that the path is absolute. See `Dir.deleteTree` for a function that
362/// operates on both absolute and relative paths.362/// operates on both absolute and relative paths.
363/// Asserts that the path parameter has no null bytes.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/// On WASI, `absolute_path` should be encoded as valid UTF-8.365/// On WASI, `absolute_path` should be encoded as valid UTF-8.
366/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding.366/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding.
367pub fn deleteTreeAbsolute(absolute_path: []const u8) !void {367pub fn deleteTreeAbsolute(absolute_path: []const u8) !void {
...@@ -379,7 +379,7 @@ pub fn deleteTreeAbsolute(absolute_path: []const u8) !void {...@@ -379,7 +379,7 @@ pub fn deleteTreeAbsolute(absolute_path: []const u8) !void {
379}379}
380380
381/// Same as `Dir.readLink`, except it asserts the path is absolute.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/// On WASI, `pathname` should be encoded as valid UTF-8.383/// On WASI, `pathname` should be encoded as valid UTF-8.
384/// On other platforms, `pathname` is an opaque sequence of bytes with no particular encoding.384/// On other platforms, `pathname` is an opaque sequence of bytes with no particular encoding.
385pub fn readLinkAbsolute(pathname: []const u8, buffer: *[max_path_bytes]u8) ![]u8 {385pub 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,7 +405,7 @@ pub fn readLinkAbsoluteZ(pathname_c: [*:0]const u8, buffer: *[max_path_bytes]u8)
405/// one; the latter case is known as a dangling link.405/// one; the latter case is known as a dangling link.
406/// If `sym_link_path` exists, it will not be overwritten.406/// If `sym_link_path` exists, it will not be overwritten.
407/// See also `symLinkAbsoluteZ` and `symLinkAbsoluteW`.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/// On WASI, both paths should be encoded as valid UTF-8.409/// On WASI, both paths should be encoded as valid UTF-8.
410/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.410/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
411pub fn symLinkAbsolute(411pub fn symLinkAbsolute(
...@@ -537,7 +537,7 @@ pub fn selfExePathAlloc(allocator: Allocator) ![]u8 {...@@ -537,7 +537,7 @@ pub fn selfExePathAlloc(allocator: Allocator) ![]u8 {
537/// This function may return an error if the current executable537/// This function may return an error if the current executable
538/// was deleted after spawning.538/// was deleted after spawning.
539/// Returned value is a slice of out_buffer.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/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.541/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
542///542///
543/// On Linux, depends on procfs being mounted. If the currently executing binary has543/// On Linux, depends on procfs being mounted. If the currently executing binary has
...@@ -677,7 +677,7 @@ pub fn selfExeDirPathAlloc(allocator: Allocator) ![]u8 {...@@ -677,7 +677,7 @@ pub fn selfExeDirPathAlloc(allocator: Allocator) ![]u8 {
677677
678/// Get the directory path that contains the current executable.678/// Get the directory path that contains the current executable.
679/// Returned value is a slice of out_buffer.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/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.681/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
682pub fn selfExeDirPath(out_buffer: []u8) SelfExePathError![]const u8 {682pub fn selfExeDirPath(out_buffer: []u8) SelfExePathError![]const u8 {
683 const self_exe_path = try selfExePath(out_buffer);683 const self_exe_path = try selfExePath(out_buffer);
...@@ -687,7 +687,7 @@ pub fn selfExeDirPath(out_buffer: []u8) SelfExePathError![]const u8 {...@@ -687,7 +687,7 @@ pub fn selfExeDirPath(out_buffer: []u8) SelfExePathError![]const u8 {
687}687}
688688
689/// `realpath`, except caller must free the returned memory.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/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.691/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
692/// See also `Dir.realpath`.692/// See also `Dir.realpath`.
693pub fn realpathAlloc(allocator: Allocator, pathname: []const u8) ![]u8 {693pub fn realpathAlloc(allocator: Allocator, pathname: []const u8) ![]u8 {
lib/std/fs/Dir.zig+32-32
...@@ -855,7 +855,7 @@ pub const OpenError = error{...@@ -855,7 +855,7 @@ pub const OpenError = error{
855 /// WASI-only; file paths must be valid UTF-8.855 /// WASI-only; file paths must be valid UTF-8.
856 InvalidUtf8,856 InvalidUtf8,
857 /// Windows-only; file paths provided by the user must be valid WTF-8.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 InvalidWtf8,859 InvalidWtf8,
860 BadPathName,860 BadPathName,
861 DeviceBusy,861 DeviceBusy,
...@@ -873,7 +873,7 @@ pub fn close(self: *Dir) void {...@@ -873,7 +873,7 @@ pub fn close(self: *Dir) void {
873/// To create a new file, see `createFile`.873/// To create a new file, see `createFile`.
874/// Call `File.close` to release the resource.874/// Call `File.close` to release the resource.
875/// Asserts that the path parameter has no null bytes.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/// On WASI, `sub_path` should be encoded as valid UTF-8.877/// On WASI, `sub_path` should be encoded as valid UTF-8.
878/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.878/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
879pub fn openFile(self: Dir, sub_path: []const u8, flags: File.OpenFlags) File.OpenError!File {879pub 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,7 +999,7 @@ pub fn openFileZ(self: Dir, sub_path: [*:0]const u8, flags: File.OpenFlags) File
999}999}
10001000
1001/// Same as `openFile` but Windows-only and the path parameter is1001/// 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.
1003pub fn openFileW(self: Dir, sub_path_w: []const u16, flags: File.OpenFlags) File.OpenError!File {1003pub fn openFileW(self: Dir, sub_path_w: []const u16, flags: File.OpenFlags) File.OpenError!File {
1004 const w = windows;1004 const w = windows;
1005 const file: File = .{1005 const file: File = .{
...@@ -1038,7 +1038,7 @@ pub fn openFileW(self: Dir, sub_path_w: []const u16, flags: File.OpenFlags) File...@@ -1038,7 +1038,7 @@ pub fn openFileW(self: Dir, sub_path_w: []const u16, flags: File.OpenFlags) File
1038/// Creates, opens, or overwrites a file with write access.1038/// Creates, opens, or overwrites a file with write access.
1039/// Call `File.close` on the result when done.1039/// Call `File.close` on the result when done.
1040/// Asserts that the path parameter has no null bytes.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/// On WASI, `sub_path` should be encoded as valid UTF-8.1042/// On WASI, `sub_path` should be encoded as valid UTF-8.
1043/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.1043/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
1044pub fn createFile(self: Dir, sub_path: []const u8, flags: File.CreateFlags) File.OpenError!File {1044pub 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,7 +1150,7 @@ pub fn createFileZ(self: Dir, sub_path_c: [*:0]const u8, flags: File.CreateFlags
1150}1150}
11511151
1152/// Same as `createFile` but Windows-only and the path parameter is1152/// 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.
1154pub fn createFileW(self: Dir, sub_path_w: []const u16, flags: File.CreateFlags) File.OpenError!File {1154pub fn createFileW(self: Dir, sub_path_w: []const u16, flags: File.CreateFlags) File.OpenError!File {
1155 const w = windows;1155 const w = windows;
1156 const read_flag = if (flags.read) @as(u32, w.GENERIC_READ) else 0;1156 const read_flag = if (flags.read) @as(u32, w.GENERIC_READ) else 0;
...@@ -1195,7 +1195,7 @@ pub const MakeError = posix.MakeDirError;...@@ -1195,7 +1195,7 @@ pub const MakeError = posix.MakeDirError;
1195/// Creates a single directory with a relative or absolute path.1195/// Creates a single directory with a relative or absolute path.
1196/// To create multiple directories to make an entire path, see `makePath`.1196/// To create multiple directories to make an entire path, see `makePath`.
1197/// To operate on only absolute paths, see `makeDirAbsolute`.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/// On WASI, `sub_path` should be encoded as valid UTF-8.1199/// On WASI, `sub_path` should be encoded as valid UTF-8.
1200/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.1200/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
1201pub fn makeDir(self: Dir, sub_path: []const u8) MakeError!void {1201pub 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,7 +1221,7 @@ pub fn makeDirW(self: Dir, sub_path: [*:0]const u16) MakeError!void {
1221/// Returns success if the path already exists and is a directory.1221/// Returns success if the path already exists and is a directory.
1222/// This function is not atomic, and if it returns an error, the file system may1222/// This function is not atomic, and if it returns an error, the file system may
1223/// have been modified regardless.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/// On WASI, `sub_path` should be encoded as valid UTF-8.1225/// On WASI, `sub_path` should be encoded as valid UTF-8.
1226/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.1226/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
1227/// Fails on an empty path with `error.BadPathName` as that is not a path that can be created.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,7 +1275,7 @@ pub fn makePathStatus(self: Dir, sub_path: []const u8) (MakeError || StatFileErr
1275/// Opens the dir if the path already exists and is a directory.1275/// Opens the dir if the path already exists and is a directory.
1276/// This function is not atomic, and if it returns an error, the file system may1276/// This function is not atomic, and if it returns an error, the file system may
1277/// have been modified regardless.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/).
1279fn makeOpenPathAccessMaskW(self: Dir, sub_path: []const u8, access_mask: u32, no_follow: bool) (MakeError || OpenError || StatFileError)!Dir {1279fn makeOpenPathAccessMaskW(self: Dir, sub_path: []const u8, access_mask: u32, no_follow: bool) (MakeError || OpenError || StatFileError)!Dir {
1280 const w = windows;1280 const w = windows;
1281 var it = try fs.path.componentIterator(sub_path);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,7 +1326,7 @@ fn makeOpenPathAccessMaskW(self: Dir, sub_path: []const u8, access_mask: u32, no
1326/// This function performs `makePath`, followed by `openDir`.1326/// This function performs `makePath`, followed by `openDir`.
1327/// If supported by the OS, this operation is atomic. It is not atomic on1327/// If supported by the OS, this operation is atomic. It is not atomic on
1328/// all operating systems.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/// On WASI, `sub_path` should be encoded as valid UTF-8.1330/// On WASI, `sub_path` should be encoded as valid UTF-8.
1331/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.1331/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
1332pub fn makeOpenPath(self: Dir, sub_path: []const u8, open_dir_options: OpenOptions) (MakeError || OpenError || StatFileError)!Dir {1332pub 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,9 +1357,9 @@ pub const RealPathError = posix.RealPathError;
1357/// `pathname` relative to this `Dir`. If `pathname` is absolute, ignores this1357/// `pathname` relative to this `Dir`. If `pathname` is absolute, ignores this
1358/// `Dir` handle and returns the canonicalized absolute pathname of `pathname`1358/// `Dir` handle and returns the canonicalized absolute pathname of `pathname`
1359/// argument.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/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.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/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.1363/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
1364/// This function is not universally supported by all platforms.1364/// This function is not universally supported by all platforms.
1365/// Currently supported hosts are: Linux, macOS, and Windows.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,7 +1429,7 @@ pub fn realpathZ(self: Dir, pathname: [*:0]const u8, out_buffer: []u8) RealPathE
1429/// Deprecated: use `realpathW2`.1429/// Deprecated: use `realpathW2`.
1430///1430///
1431/// Windows-only. Same as `Dir.realpath` except `pathname` is WTF16 LE encoded.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/// See also `Dir.realpath`, `realpathW`.1433/// See also `Dir.realpath`, `realpathW`.
1434pub fn realpathW(self: Dir, pathname: []const u16, out_buffer: []u8) RealPathError![]u8 {1434pub fn realpathW(self: Dir, pathname: []const u16, out_buffer: []u8) RealPathError![]u8 {
1435 var wide_buf: [std.os.windows.PATH_MAX_WIDE]u16 = undefined;1435 var wide_buf: [std.os.windows.PATH_MAX_WIDE]u16 = undefined;
...@@ -1529,7 +1529,7 @@ pub const OpenOptions = struct {...@@ -1529,7 +1529,7 @@ pub const OpenOptions = struct {
1529/// open until `close` is called on the result.1529/// open until `close` is called on the result.
1530/// The directory cannot be iterated unless the `iterate` option is set to `true`.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/// On WASI, `sub_path` should be encoded as valid UTF-8.1533/// On WASI, `sub_path` should be encoded as valid UTF-8.
1534/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.1534/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
1535/// Asserts that the path parameter has no null bytes.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,7 +1744,7 @@ fn makeOpenDirAccessMaskW(self: Dir, sub_path_w: [*:0]const u16, access_mask: u3
1744pub const DeleteFileError = posix.UnlinkError;1744pub const DeleteFileError = posix.UnlinkError;
17451745
1746/// Delete a file name and possibly the file it refers to, based on an open directory handle.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/// On WASI, `sub_path` should be encoded as valid UTF-8.1748/// On WASI, `sub_path` should be encoded as valid UTF-8.
1749/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.1749/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
1750/// Asserts that the path parameter has no null bytes.1750/// Asserts that the path parameter has no null bytes.
...@@ -1805,7 +1805,7 @@ pub const DeleteDirError = error{...@@ -1805,7 +1805,7 @@ pub const DeleteDirError = error{
1805 /// WASI-only; file paths must be valid UTF-8.1805 /// WASI-only; file paths must be valid UTF-8.
1806 InvalidUtf8,1806 InvalidUtf8,
1807 /// Windows-only; file paths provided by the user must be valid WTF-8.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 InvalidWtf8,1809 InvalidWtf8,
1810 BadPathName,1810 BadPathName,
1811 /// On Windows, `\\server` or `\\server\share` was not found.1811 /// On Windows, `\\server` or `\\server\share` was not found.
...@@ -1816,7 +1816,7 @@ pub const DeleteDirError = error{...@@ -1816,7 +1816,7 @@ pub const DeleteDirError = error{
18161816
1817/// Returns `error.DirNotEmpty` if the directory is not empty.1817/// Returns `error.DirNotEmpty` if the directory is not empty.
1818/// To delete a directory recursively, see `deleteTree`.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/// On WASI, `sub_path` should be encoded as valid UTF-8.1820/// On WASI, `sub_path` should be encoded as valid UTF-8.
1821/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.1821/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
1822/// Asserts that the path parameter has no null bytes.1822/// Asserts that the path parameter has no null bytes.
...@@ -1858,7 +1858,7 @@ pub const RenameError = posix.RenameError;...@@ -1858,7 +1858,7 @@ pub const RenameError = posix.RenameError;
1858/// If new_sub_path already exists, it will be replaced.1858/// If new_sub_path already exists, it will be replaced.
1859/// Renaming a file over an existing directory or a directory1859/// Renaming a file over an existing directory or a directory
1860/// over an existing file will fail with `error.IsDir` or `error.NotDir`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/// On WASI, both paths should be encoded as valid UTF-8.1862/// On WASI, both paths should be encoded as valid UTF-8.
1863/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.1863/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
1864pub fn rename(self: Dir, old_sub_path: []const u8, new_sub_path: []const u8) RenameError!void {1864pub 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,7 +1889,7 @@ pub const SymLinkFlags = struct {
1889/// A symbolic link (also known as a soft link) may point to an existing file or to a nonexistent1889/// A symbolic link (also known as a soft link) may point to an existing file or to a nonexistent
1890/// one; the latter case is known as a dangling link.1890/// one; the latter case is known as a dangling link.
1891/// If `sym_link_path` exists, it will not be overwritten.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/// On WASI, both paths should be encoded as valid UTF-8.1893/// On WASI, both paths should be encoded as valid UTF-8.
1894/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.1894/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
1895pub fn symLink(1895pub fn symLink(
...@@ -1972,7 +1972,7 @@ pub fn symLinkW(...@@ -1972,7 +1972,7 @@ pub fn symLinkW(
1972/// Same as `symLink`, except tries to create the symbolic link until it1972/// Same as `symLink`, except tries to create the symbolic link until it
1973/// succeeds or encounters an error other than `error.PathAlreadyExists`.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/// * On WASI, both paths should be encoded as valid UTF-8.1976/// * On WASI, both paths should be encoded as valid UTF-8.
1977/// * On other platforms, both paths are an opaque sequence of bytes with no particular encoding.1977/// * On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
1978pub fn atomicSymLink(1978pub fn atomicSymLink(
...@@ -2018,7 +2018,7 @@ pub const ReadLinkError = posix.ReadLinkError;...@@ -2018,7 +2018,7 @@ pub const ReadLinkError = posix.ReadLinkError;
2018/// Read value of a symbolic link.2018/// Read value of a symbolic link.
2019/// The return value is a slice of `buffer`, from index `0`.2019/// The return value is a slice of `buffer`, from index `0`.
2020/// Asserts that the path parameter has no null bytes.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/// On WASI, `sub_path` should be encoded as valid UTF-8.2022/// On WASI, `sub_path` should be encoded as valid UTF-8.
2023/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.2023/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
2024pub fn readLink(self: Dir, sub_path: []const u8, buffer: []u8) ReadLinkError![]u8 {2024pub 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,7 +2058,7 @@ pub fn readLinkW(self: Dir, sub_path_w: []const u16, buffer: []u8) ![]u8 {
2058/// the situation is ambiguous. It could either mean that the entire file was read, and2058/// the situation is ambiguous. It could either mean that the entire file was read, and
2059/// it exactly fits the buffer, or it could mean the buffer was not big enough for the2059/// it exactly fits the buffer, or it could mean the buffer was not big enough for the
2060/// entire file.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/// On WASI, `file_path` should be encoded as valid UTF-8.2062/// On WASI, `file_path` should be encoded as valid UTF-8.
2063/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.2063/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.
2064pub fn readFile(self: Dir, file_path: []const u8, buffer: []u8) ![]u8 {2064pub 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,7 +2085,7 @@ pub const ReadFileAllocError = File.OpenError || File.ReadError || Allocator.Err
2085/// `File.Reader` which handles this seamlessly.2085/// `File.Reader` which handles this seamlessly.
2086pub fn readFileAlloc(2086pub fn readFileAlloc(
2087 dir: Dir,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 /// On WASI, should be encoded as valid UTF-8.2089 /// On WASI, should be encoded as valid UTF-8.
2090 /// On other platforms, an opaque sequence of bytes with no particular encoding.2090 /// On other platforms, an opaque sequence of bytes with no particular encoding.
2091 sub_path: []const u8,2091 sub_path: []const u8,
...@@ -2104,7 +2104,7 @@ pub fn readFileAlloc(...@@ -2104,7 +2104,7 @@ pub fn readFileAlloc(
2104/// `File.Reader`.2104/// `File.Reader`.
2105pub fn readFileAllocOptions(2105pub fn readFileAllocOptions(
2106 dir: Dir,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 /// On WASI, should be encoded as valid UTF-8.2108 /// On WASI, should be encoded as valid UTF-8.
2109 /// On other platforms, an opaque sequence of bytes with no particular encoding.2109 /// On other platforms, an opaque sequence of bytes with no particular encoding.
2110 sub_path: []const u8,2110 sub_path: []const u8,
...@@ -2148,7 +2148,7 @@ pub const DeleteTreeError = error{...@@ -2148,7 +2148,7 @@ pub const DeleteTreeError = error{
2148 InvalidUtf8,2148 InvalidUtf8,
21492149
2150 /// Windows-only; file paths provided by the user must be valid WTF-8.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 InvalidWtf8,2152 InvalidWtf8,
21532153
2154 /// On Windows, file paths cannot contain these characters:2154 /// On Windows, file paths cannot contain these characters:
...@@ -2163,7 +2163,7 @@ pub const DeleteTreeError = error{...@@ -2163,7 +2163,7 @@ pub const DeleteTreeError = error{
2163/// removes it. If it cannot be removed because it is a non-empty directory,2163/// removes it. If it cannot be removed because it is a non-empty directory,
2164/// this function recursively removes its entries and then tries again.2164/// this function recursively removes its entries and then tries again.
2165/// This operation is not atomic on most file systems.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/// On WASI, `sub_path` should be encoded as valid UTF-8.2167/// On WASI, `sub_path` should be encoded as valid UTF-8.
2168/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.2168/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
2169pub fn deleteTree(self: Dir, sub_path: []const u8) DeleteTreeError!void {2169pub 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,7 +2370,7 @@ pub fn deleteTree(self: Dir, sub_path: []const u8) DeleteTreeError!void {
23702370
2371/// Like `deleteTree`, but only keeps one `Iterator` active at a time to minimize the function's stack size.2371/// Like `deleteTree`, but only keeps one `Iterator` active at a time to minimize the function's stack size.
2372/// This is slower than `deleteTree` but uses less stack space.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/// On WASI, `sub_path` should be encoded as valid UTF-8.2374/// On WASI, `sub_path` should be encoded as valid UTF-8.
2375/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.2375/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
2376pub fn deleteTreeMinStackSize(self: Dir, sub_path: []const u8) DeleteTreeError!void {2376pub 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,7 +2568,7 @@ fn deleteTreeOpenInitialSubpath(self: Dir, sub_path: []const u8, kind_hint: File
2568pub const WriteFileError = File.WriteError || File.OpenError;2568pub const WriteFileError = File.WriteError || File.OpenError;
25692569
2570pub const WriteFileOptions = struct {2570pub 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 /// On WASI, `sub_path` should be encoded as valid UTF-8.2572 /// On WASI, `sub_path` should be encoded as valid UTF-8.
2573 /// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.2573 /// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
2574 sub_path: []const u8,2574 sub_path: []const u8,
...@@ -2586,7 +2586,7 @@ pub fn writeFile(self: Dir, options: WriteFileOptions) WriteFileError!void {...@@ -2586,7 +2586,7 @@ pub fn writeFile(self: Dir, options: WriteFileOptions) WriteFileError!void {
2586pub const AccessError = posix.AccessError;2586pub const AccessError = posix.AccessError;
25872587
2588/// Test accessing `sub_path`.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/// On WASI, `sub_path` should be encoded as valid UTF-8.2590/// On WASI, `sub_path` should be encoded as valid UTF-8.
2591/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.2591/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
2592/// Be careful of Time-Of-Check-Time-Of-Use race conditions when using this function.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,7 +2641,7 @@ pub const PrevStatus = enum {
2641/// atime, and mode of the source file so that the next call to `updateFile` will not need a copy.2641/// atime, and mode of the source file so that the next call to `updateFile` will not need a copy.
2642/// Returns the previous status of the file before updating.2642/// Returns the previous status of the file before updating.
2643/// If any of the directories do not exist for dest_path, they are created.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/// On WASI, both paths should be encoded as valid UTF-8.2645/// On WASI, both paths should be encoded as valid UTF-8.
2646/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.2646/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
2647pub fn updateFile(2647pub fn updateFile(
...@@ -2713,7 +2713,7 @@ pub const CopyFileError = File.OpenError || File.StatError ||...@@ -2713,7 +2713,7 @@ pub const CopyFileError = File.OpenError || File.StatError ||
2713/// dest_path.2713/// dest_path.
2714///2714///
2715/// On Windows, both paths should be encoded as2715/// On Windows, both paths should be encoded as
2716/// [WTF-8](https://simonsapin.github.io/wtf-8/). On WASI, both paths should be2716/// [WTF-8](https://wtf-8.codeberg.page/). On WASI, both paths should be
2717/// encoded as valid UTF-8. On other platforms, both paths are an opaque2717/// encoded as valid UTF-8. On other platforms, both paths are an opaque
2718/// sequence of bytes with no particular encoding.2718/// sequence of bytes with no particular encoding.
2719pub fn copyFile(2719pub fn copyFile(
...@@ -2758,7 +2758,7 @@ pub const AtomicFileOptions = struct {...@@ -2758,7 +2758,7 @@ pub const AtomicFileOptions = struct {
2758/// Always call `AtomicFile.deinit` to clean up, regardless of whether2758/// Always call `AtomicFile.deinit` to clean up, regardless of whether
2759/// `AtomicFile.finish` succeeded. `dest_path` must remain valid until2759/// `AtomicFile.finish` succeeded. `dest_path` must remain valid until
2760/// `AtomicFile.deinit` is called.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/// On WASI, `dest_path` should be encoded as valid UTF-8.2762/// On WASI, `dest_path` should be encoded as valid UTF-8.
2763/// On other platforms, `dest_path` is an opaque sequence of bytes with no particular encoding.2763/// On other platforms, `dest_path` is an opaque sequence of bytes with no particular encoding.
2764pub fn atomicFile(self: Dir, dest_path: []const u8, options: AtomicFileOptions) !AtomicFile {2764pub 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,7 +2792,7 @@ pub const StatFileError = File.OpenError || File.StatError || posix.FStatAtError
2792/// Symlinks are followed.2792/// Symlinks are followed.
2793///2793///
2794/// `sub_path` may be absolute, in which case `self` is ignored.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/// On WASI, `sub_path` should be encoded as valid UTF-8.2796/// On WASI, `sub_path` should be encoded as valid UTF-8.
2797/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.2797/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
2798pub fn statFile(self: Dir, sub_path: []const u8) StatFileError!Stat {2798pub 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,7 +60,7 @@ pub const OpenError = error{
60 /// WASI-only; file paths must be valid UTF-8.60 /// WASI-only; file paths must be valid UTF-8.
61 InvalidUtf8,61 InvalidUtf8,
62 /// Windows-only; file paths provided by the user must be valid WTF-8.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 InvalidWtf8,64 InvalidWtf8,
65 /// On Windows, file paths cannot contain these characters:65 /// On Windows, file paths cannot contain these characters:
66 /// '/', '*', '?', '"', '<', '>', '|'66 /// '/', '*', '?', '"', '<', '>', '|'
lib/std/fs/path.zig+1-1
...@@ -2,7 +2,7 @@...@@ -2,7 +2,7 @@
2//!2//!
3//! Windows paths are arbitrary sequences of `u16` (WTF-16).3//! Windows paths are arbitrary sequences of `u16` (WTF-16).
4//! For cross-platform APIs that deal with sequences of `u8`, Windows4//! 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//! WTF-8 is a superset of UTF-8 that allows encoding surrogate codepoints,6//! WTF-8 is a superset of UTF-8 that allows encoding surrogate codepoints,
7//! which enables lossless roundtripping when converting to/from WTF-167//! which enables lossless roundtripping when converting to/from WTF-16
8//! (as long as the WTF-8 encoded surrogate codepoints do not form a pair).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,7 +98,7 @@ pub fn isGetFdPathSupportedOnTarget(os: std.Target.Os) bool {
98/// For example, while it generally works on Linux, macOS, FreeBSD or Windows, it is98/// For example, while it generally works on Linux, macOS, FreeBSD or Windows, it is
99/// unsupported on WASI.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/// * On other platforms, the result is an opaque sequence of bytes with no particular encoding.102/// * On other platforms, the result is an opaque sequence of bytes with no particular encoding.
103///103///
104/// Calling this function is usually a bug.104/// Calling this function is usually a bug.
lib/std/os/windows.zig+4-4
...@@ -749,7 +749,7 @@ pub const GetCurrentDirectoryError = error{...@@ -749,7 +749,7 @@ pub const GetCurrentDirectoryError = error{
749};749};
750750
751/// The result is a slice of `buffer`, indexed from 0.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/).
753pub fn GetCurrentDirectory(buffer: []u8) GetCurrentDirectoryError![]u8 {753pub fn GetCurrentDirectory(buffer: []u8) GetCurrentDirectoryError![]u8 {
754 var wtf16le_buf: [PATH_MAX_WIDE:0]u16 = undefined;754 var wtf16le_buf: [PATH_MAX_WIDE:0]u16 = undefined;
755 const result = kernel32.GetCurrentDirectoryW(wtf16le_buf.len + 1, &wtf16le_buf);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,7 +976,7 @@ pub fn ReadLink(dir: ?HANDLE, sub_path_w: []const u16, out_buffer: []u8) ReadLin
976}976}
977977
978/// Asserts that there is enough space is `out_buffer`.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/).
980fn parseReadlinkPath(path: []const u16, is_relative: bool, out_buffer: []u8) []u8 {980fn parseReadlinkPath(path: []const u16, is_relative: bool, out_buffer: []u8) []u8 {
981 const win32_namespace_path = path: {981 const win32_namespace_path = path: {
982 if (is_relative) break :path path;982 if (is_relative) break :path path;
...@@ -2416,13 +2416,13 @@ pub const Wtf8ToPrefixedFileWError = error{InvalidWtf8} || Wtf16ToPrefixedFileWE...@@ -2416,13 +2416,13 @@ pub const Wtf8ToPrefixedFileWError = error{InvalidWtf8} || Wtf16ToPrefixedFileWE
24162416
2417/// Same as `sliceToPrefixedFileW` but accepts a pointer2417/// Same as `sliceToPrefixedFileW` but accepts a pointer
2418/// to a null-terminated WTF-8 encoded path.2418/// to a null-terminated WTF-8 encoded path.
2419/// https://simonsapin.github.io/wtf-8/2419/// https://wtf-8.codeberg.page/
2420pub fn cStrToPrefixedFileW(dir: ?HANDLE, s: [*:0]const u8) Wtf8ToPrefixedFileWError!PathSpace {2420pub fn cStrToPrefixedFileW(dir: ?HANDLE, s: [*:0]const u8) Wtf8ToPrefixedFileWError!PathSpace {
2421 return sliceToPrefixedFileW(dir, mem.sliceTo(s, 0));2421 return sliceToPrefixedFileW(dir, mem.sliceTo(s, 0));
2422}2422}
24232423
2424/// Same as `wToPrefixedFileW` but accepts a WTF-8 encoded path.2424/// Same as `wToPrefixedFileW` but accepts a WTF-8 encoded path.
2425/// https://simonsapin.github.io/wtf-8/2425/// https://wtf-8.codeberg.page/
2426pub fn sliceToPrefixedFileW(dir: ?HANDLE, path: []const u8) Wtf8ToPrefixedFileWError!PathSpace {2426pub fn sliceToPrefixedFileW(dir: ?HANDLE, path: []const u8) Wtf8ToPrefixedFileWError!PathSpace {
2427 var temp_path: PathSpace = undefined;2427 var temp_path: PathSpace = undefined;
2428 temp_path.len = try std.unicode.wtf8ToWtf16Le(&temp_path.data, path);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,7 +1624,7 @@ pub const OpenError = error{
1624 InvalidUtf8,1624 InvalidUtf8,
16251625
1626 /// Windows-only; file paths provided by the user must be valid WTF-8.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 InvalidWtf8,1628 InvalidWtf8,
16291629
1630 /// On Windows, `\\server` or `\\server\share` was not found.1630 /// On Windows, `\\server` or `\\server\share` was not found.
...@@ -1647,7 +1647,7 @@ pub const OpenError = error{...@@ -1647,7 +1647,7 @@ pub const OpenError = error{
1647} || UnexpectedError;1647} || UnexpectedError;
16481648
1649/// Open and possibly create a file. Keeps trying if it gets interrupted.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/// On WASI, `file_path` should be encoded as valid UTF-8.1651/// On WASI, `file_path` should be encoded as valid UTF-8.
1652/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.1652/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.
1653/// See also `openZ`.1653/// See also `openZ`.
...@@ -1662,7 +1662,7 @@ pub fn open(file_path: []const u8, flags: O, perm: mode_t) OpenError!fd_t {...@@ -1662,7 +1662,7 @@ pub fn open(file_path: []const u8, flags: O, perm: mode_t) OpenError!fd_t {
1662}1662}
16631663
1664/// Open and possibly create a file. Keeps trying if it gets interrupted.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/// On WASI, `file_path` should be encoded as valid UTF-8.1666/// On WASI, `file_path` should be encoded as valid UTF-8.
1667/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.1667/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.
1668/// See also `open`.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,7 +1710,7 @@ pub fn openZ(file_path: [*:0]const u8, flags: O, perm: mode_t) OpenError!fd_t {
17101710
1711/// Open and possibly create a file. Keeps trying if it gets interrupted.1711/// Open and possibly create a file. Keeps trying if it gets interrupted.
1712/// `file_path` is relative to the open directory handle `dir_fd`.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/// On WASI, `file_path` should be encoded as valid UTF-8.1714/// On WASI, `file_path` should be encoded as valid UTF-8.
1715/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.1715/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.
1716/// See also `openatZ`.1716/// See also `openatZ`.
...@@ -1833,7 +1833,7 @@ fn openOptionsFromFlagsWasi(oflag: O) OpenError!WasiOpenOptions {...@@ -1833,7 +1833,7 @@ fn openOptionsFromFlagsWasi(oflag: O) OpenError!WasiOpenOptions {
18331833
1834/// Open and possibly create a file. Keeps trying if it gets interrupted.1834/// Open and possibly create a file. Keeps trying if it gets interrupted.
1835/// `file_path` is relative to the open directory handle `dir_fd`.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/// On WASI, `file_path` should be encoded as valid UTF-8.1837/// On WASI, `file_path` should be encoded as valid UTF-8.
1838/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.1838/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.
1839/// See also `openat`.1839/// See also `openat`.
...@@ -2137,7 +2137,7 @@ pub const SymLinkError = error{...@@ -2137,7 +2137,7 @@ pub const SymLinkError = error{
2137 InvalidUtf8,2137 InvalidUtf8,
21382138
2139 /// Windows-only; file paths provided by the user must be valid WTF-8.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 InvalidWtf8,2141 InvalidWtf8,
21422142
2143 BadPathName,2143 BadPathName,
...@@ -2146,7 +2146,7 @@ pub const SymLinkError = error{...@@ -2146,7 +2146,7 @@ pub const SymLinkError = error{
2146/// Creates a symbolic link named `sym_link_path` which contains the string `target_path`.2146/// Creates a symbolic link named `sym_link_path` which contains the string `target_path`.
2147/// A symbolic link (also known as a soft link) may point to an existing file or to a nonexistent2147/// A symbolic link (also known as a soft link) may point to an existing file or to a nonexistent
2148/// one; the latter case is known as a dangling link.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/// On WASI, both paths should be encoded as valid UTF-8.2150/// On WASI, both paths should be encoded as valid UTF-8.
2151/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.2151/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
2152/// If `sym_link_path` exists, it will not be overwritten.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,7 +2198,7 @@ pub fn symlinkZ(target_path: [*:0]const u8, sym_link_path: [*:0]const u8) SymLin
2198/// `target_path` **relative** to `newdirfd` directory handle.2198/// `target_path` **relative** to `newdirfd` directory handle.
2199/// A symbolic link (also known as a soft link) may point to an existing file or to a nonexistent2199/// A symbolic link (also known as a soft link) may point to an existing file or to a nonexistent
2200/// one; the latter case is known as a dangling link.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/// On WASI, both paths should be encoded as valid UTF-8.2202/// On WASI, both paths should be encoded as valid UTF-8.
2203/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.2203/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
2204/// If `sym_link_path` exists, it will not be overwritten.2204/// If `sym_link_path` exists, it will not be overwritten.
...@@ -2446,7 +2446,7 @@ pub const UnlinkError = error{...@@ -2446,7 +2446,7 @@ pub const UnlinkError = error{
2446 InvalidUtf8,2446 InvalidUtf8,
24472447
2448 /// Windows-only; file paths provided by the user must be valid WTF-8.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 InvalidWtf8,2450 InvalidWtf8,
24512451
2452 /// On Windows, file paths cannot contain these characters:2452 /// On Windows, file paths cannot contain these characters:
...@@ -2458,7 +2458,7 @@ pub const UnlinkError = error{...@@ -2458,7 +2458,7 @@ pub const UnlinkError = error{
2458} || UnexpectedError;2458} || UnexpectedError;
24592459
2460/// Delete a name and possibly the file it refers to.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/// On WASI, `file_path` should be encoded as valid UTF-8.2462/// On WASI, `file_path` should be encoded as valid UTF-8.
2463/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.2463/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.
2464/// See also `unlinkZ`.2464/// See also `unlinkZ`.
...@@ -2522,7 +2522,7 @@ pub const UnlinkatError = UnlinkError || error{...@@ -2522,7 +2522,7 @@ pub const UnlinkatError = UnlinkError || error{
2522};2522};
25232523
2524/// Delete a file name and possibly the file it refers to, based on an open directory handle.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/// On WASI, `file_path` should be encoded as valid UTF-8.2526/// On WASI, `file_path` should be encoded as valid UTF-8.
2527/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.2527/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.
2528/// Asserts that the path parameter has no null bytes.2528/// Asserts that the path parameter has no null bytes.
...@@ -2637,7 +2637,7 @@ pub const RenameError = error{...@@ -2637,7 +2637,7 @@ pub const RenameError = error{
2637 /// WASI-only; file paths must be valid UTF-8.2637 /// WASI-only; file paths must be valid UTF-8.
2638 InvalidUtf8,2638 InvalidUtf8,
2639 /// Windows-only; file paths provided by the user must be valid WTF-8.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 InvalidWtf8,2641 InvalidWtf8,
2642 BadPathName,2642 BadPathName,
2643 NoDevice,2643 NoDevice,
...@@ -2654,7 +2654,7 @@ pub const RenameError = error{...@@ -2654,7 +2654,7 @@ pub const RenameError = error{
2654} || UnexpectedError;2654} || UnexpectedError;
26552655
2656/// Change the name or location of a file.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/// On WASI, both paths should be encoded as valid UTF-8.2658/// On WASI, both paths should be encoded as valid UTF-8.
2659/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.2659/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
2660pub fn rename(old_path: []const u8, new_path: []const u8) RenameError!void {2660pub 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,7 +2716,7 @@ pub fn renameW(old_path: [*:0]const u16, new_path: [*:0]const u16) RenameError!v
2716}2716}
27172717
2718/// Change the name or location of a file based on an open directory handle.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/// On WASI, both paths should be encoded as valid UTF-8.2720/// On WASI, both paths should be encoded as valid UTF-8.
2721/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.2721/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
2722pub fn renameat(2722pub fn renameat(
...@@ -2824,7 +2824,7 @@ pub fn renameatZ(...@@ -2824,7 +2824,7 @@ pub fn renameatZ(
2824}2824}
28252825
2826/// Same as `renameat` but Windows-only and the path parameters are2826/// 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.
2828pub fn renameatW(2828pub fn renameatW(
2829 old_dir_fd: fd_t,2829 old_dir_fd: fd_t,
2830 old_path_w: []const u16,2830 old_path_w: []const u16,
...@@ -2930,7 +2930,7 @@ pub fn renameatW(...@@ -2930,7 +2930,7 @@ pub fn renameatW(
2930 }2930 }
2931}2931}
29322932
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/// On WASI, `sub_dir_path` should be encoded as valid UTF-8.2934/// On WASI, `sub_dir_path` should be encoded as valid UTF-8.
2935/// On other platforms, `sub_dir_path` is an opaque sequence of bytes with no particular encoding.2935/// On other platforms, `sub_dir_path` is an opaque sequence of bytes with no particular encoding.
2936pub fn mkdirat(dir_fd: fd_t, sub_dir_path: []const u8, mode: mode_t) MakeDirError!void {2936pub 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,7 +3040,7 @@ pub const MakeDirError = error{
3040 /// WASI-only; file paths must be valid UTF-8.3040 /// WASI-only; file paths must be valid UTF-8.
3041 InvalidUtf8,3041 InvalidUtf8,
3042 /// Windows-only; file paths provided by the user must be valid WTF-8.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 InvalidWtf8,3044 InvalidWtf8,
3045 BadPathName,3045 BadPathName,
3046 NoDevice,3046 NoDevice,
...@@ -3050,7 +3050,7 @@ pub const MakeDirError = error{...@@ -3050,7 +3050,7 @@ pub const MakeDirError = error{
30503050
3051/// Create a directory.3051/// Create a directory.
3052/// `mode` is ignored on Windows and WASI.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/// On WASI, `dir_path` should be encoded as valid UTF-8.3054/// On WASI, `dir_path` should be encoded as valid UTF-8.
3055/// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding.3055/// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding.
3056pub fn mkdir(dir_path: []const u8, mode: mode_t) MakeDirError!void {3056pub 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,7 +3066,7 @@ pub fn mkdir(dir_path: []const u8, mode: mode_t) MakeDirError!void {
3066}3066}
30673067
3068/// Same as `mkdir` but the parameter is null-terminated.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/// On WASI, `dir_path` should be encoded as valid UTF-8.3070/// On WASI, `dir_path` should be encoded as valid UTF-8.
3071/// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding.3071/// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding.
3072pub fn mkdirZ(dir_path: [*:0]const u8, mode: mode_t) MakeDirError!void {3072pub fn mkdirZ(dir_path: [*:0]const u8, mode: mode_t) MakeDirError!void {
...@@ -3132,7 +3132,7 @@ pub const DeleteDirError = error{...@@ -3132,7 +3132,7 @@ pub const DeleteDirError = error{
3132 /// WASI-only; file paths must be valid UTF-8.3132 /// WASI-only; file paths must be valid UTF-8.
3133 InvalidUtf8,3133 InvalidUtf8,
3134 /// Windows-only; file paths provided by the user must be valid WTF-8.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 InvalidWtf8,3136 InvalidWtf8,
3137 BadPathName,3137 BadPathName,
3138 /// On Windows, `\\server` or `\\server\share` was not found.3138 /// On Windows, `\\server` or `\\server\share` was not found.
...@@ -3140,7 +3140,7 @@ pub const DeleteDirError = error{...@@ -3140,7 +3140,7 @@ pub const DeleteDirError = error{
3140} || UnexpectedError;3140} || UnexpectedError;
31413141
3142/// Deletes an empty directory.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/// On WASI, `dir_path` should be encoded as valid UTF-8.3144/// On WASI, `dir_path` should be encoded as valid UTF-8.
3145/// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding.3145/// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding.
3146pub fn rmdir(dir_path: []const u8) DeleteDirError!void {3146pub fn rmdir(dir_path: []const u8) DeleteDirError!void {
...@@ -3160,7 +3160,7 @@ pub fn rmdir(dir_path: []const u8) DeleteDirError!void {...@@ -3160,7 +3160,7 @@ pub fn rmdir(dir_path: []const u8) DeleteDirError!void {
3160}3160}
31613161
3162/// Same as `rmdir` except the parameter is null-terminated.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/// On WASI, `dir_path` should be encoded as valid UTF-8.3164/// On WASI, `dir_path` should be encoded as valid UTF-8.
3165/// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding.3165/// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding.
3166pub fn rmdirZ(dir_path: [*:0]const u8) DeleteDirError!void {3166pub fn rmdirZ(dir_path: [*:0]const u8) DeleteDirError!void {
...@@ -3213,12 +3213,12 @@ pub const ChangeCurDirError = error{...@@ -3213,12 +3213,12 @@ pub const ChangeCurDirError = error{
3213 /// WASI-only; file paths must be valid UTF-8.3213 /// WASI-only; file paths must be valid UTF-8.
3214 InvalidUtf8,3214 InvalidUtf8,
3215 /// Windows-only; file paths provided by the user must be valid WTF-8.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 InvalidWtf8,3217 InvalidWtf8,
3218} || UnexpectedError;3218} || UnexpectedError;
32193219
3220/// Changes the current working directory of the calling process.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/// On WASI, `dir_path` should be encoded as valid UTF-8.3222/// On WASI, `dir_path` should be encoded as valid UTF-8.
3223/// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding.3223/// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding.
3224pub fn chdir(dir_path: []const u8) ChangeCurDirError!void {3224pub fn chdir(dir_path: []const u8) ChangeCurDirError!void {
...@@ -3238,7 +3238,7 @@ pub fn chdir(dir_path: []const u8) ChangeCurDirError!void {...@@ -3238,7 +3238,7 @@ pub fn chdir(dir_path: []const u8) ChangeCurDirError!void {
3238}3238}
32393239
3240/// Same as `chdir` except the parameter is null-terminated.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/// On WASI, `dir_path` should be encoded as valid UTF-8.3242/// On WASI, `dir_path` should be encoded as valid UTF-8.
3243/// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding.3243/// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding.
3244pub fn chdirZ(dir_path: [*:0]const u8) ChangeCurDirError!void {3244pub fn chdirZ(dir_path: [*:0]const u8) ChangeCurDirError!void {
...@@ -3315,7 +3315,7 @@ pub const ReadLinkError = error{...@@ -3315,7 +3315,7 @@ pub const ReadLinkError = error{
3315 /// WASI-only; file paths must be valid UTF-8.3315 /// WASI-only; file paths must be valid UTF-8.
3316 InvalidUtf8,3316 InvalidUtf8,
3317 /// Windows-only; file paths provided by the user must be valid WTF-8.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 InvalidWtf8,3319 InvalidWtf8,
3320 BadPathName,3320 BadPathName,
3321 /// Windows-only. This error may occur if the opened reparse point is3321 /// Windows-only. This error may occur if the opened reparse point is
...@@ -3326,11 +3326,11 @@ pub const ReadLinkError = error{...@@ -3326,11 +3326,11 @@ pub const ReadLinkError = error{
3326} || UnexpectedError;3326} || UnexpectedError;
33273327
3328/// Read value of a symbolic link.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/// On WASI, `file_path` should be encoded as valid UTF-8.3330/// On WASI, `file_path` should be encoded as valid UTF-8.
3331/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.3331/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.
3332/// The return value is a slice of `out_buffer` from index 0.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/// On WASI, the result is encoded as UTF-8.3334/// On WASI, the result is encoded as UTF-8.
3335/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.3335/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
3336pub fn readlink(file_path: []const u8, out_buffer: []u8) ReadLinkError![]u8 {3336pub 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,7 +3346,7 @@ pub fn readlink(file_path: []const u8, out_buffer: []u8) ReadLinkError![]u8 {
3346}3346}
33473347
3348/// Windows-only. Same as `readlink` except `file_path` is WTF16 LE encoded.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/// See also `readlinkZ`.3350/// See also `readlinkZ`.
3351pub fn readlinkW(file_path: []const u16, out_buffer: []u8) ReadLinkError![]u8 {3351pub fn readlinkW(file_path: []const u16, out_buffer: []u8) ReadLinkError![]u8 {
3352 return windows.ReadLink(fs.cwd().fd, file_path, out_buffer);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,11 +3381,11 @@ pub fn readlinkZ(file_path: [*:0]const u8, out_buffer: []u8) ReadLinkError![]u8
3381}3381}
33823382
3383/// Similar to `readlink` except reads value of a symbolink link **relative** to `dirfd` directory handle.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/// On WASI, `file_path` should be encoded as valid UTF-8.3385/// On WASI, `file_path` should be encoded as valid UTF-8.
3386/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.3386/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.
3387/// The return value is a slice of `out_buffer` from index 0.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/// On WASI, the result is encoded as UTF-8.3389/// On WASI, the result is encoded as UTF-8.
3390/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.3390/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
3391/// See also `readlinkatWasi`, `realinkatZ` and `realinkatW`.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,7 +3423,7 @@ pub fn readlinkatWasi(dirfd: fd_t, file_path: []const u8, out_buffer: []u8) Read
3423}3423}
34243424
3425/// Windows-only. Same as `readlinkat` except `file_path` is null-terminated, WTF16 LE encoded.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/// See also `readlinkat`.3427/// See also `readlinkat`.
3428pub fn readlinkatW(dirfd: fd_t, file_path: []const u16, out_buffer: []u8) ReadLinkError![]u8 {3428pub fn readlinkatW(dirfd: fd_t, file_path: []const u16, out_buffer: []u8) ReadLinkError![]u8 {
3429 return windows.ReadLink(dirfd, file_path, out_buffer);3429 return windows.ReadLink(dirfd, file_path, out_buffer);
...@@ -5058,13 +5058,13 @@ pub const AccessError = error{...@@ -5058,13 +5058,13 @@ pub const AccessError = error{
5058 /// WASI-only; file paths must be valid UTF-8.5058 /// WASI-only; file paths must be valid UTF-8.
5059 InvalidUtf8,5059 InvalidUtf8,
5060 /// Windows-only; file paths provided by the user must be valid WTF-8.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 InvalidWtf8,5062 InvalidWtf8,
5063} || UnexpectedError;5063} || UnexpectedError;
50645064
5065/// check user's permissions for a file5065/// 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/// * On WASI, invalid UTF-8 passed to `path` causes `error.InvalidUtf8`.5068/// * On WASI, invalid UTF-8 passed to `path` causes `error.InvalidUtf8`.
5069/// * On other platforms, `path` is an opaque sequence of bytes with no particular encoding.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,7 +5115,7 @@ pub fn accessZ(path: [*:0]const u8, mode: u32) AccessError!void {
51155115
5116/// Check user's permissions for a file, based on an open directory handle.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/// * On WASI, invalid UTF-8 passed to `path` causes `error.InvalidUtf8`.5119/// * On WASI, invalid UTF-8 passed to `path` causes `error.InvalidUtf8`.
5120/// * On other platforms, `path` is an opaque sequence of bytes with no particular encoding.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,7 +5635,7 @@ pub const RealPathError = error{
5635 PipeBusy,5635 PipeBusy,
56365636
5637 /// Windows-only; file paths provided by the user must be valid WTF-8.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 InvalidWtf8,5639 InvalidWtf8,
56405640
5641 /// On Windows, `\\server` or `\\server\share` was not found.5641 /// On Windows, `\\server` or `\\server\share` was not found.
...@@ -5660,7 +5660,7 @@ pub const RealPathError = error{...@@ -5660,7 +5660,7 @@ pub const RealPathError = error{
5660/// Expands all symbolic links and resolves references to `.`, `..`, and5660/// Expands all symbolic links and resolves references to `.`, `..`, and
5661/// extra `/` characters in `pathname`.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/// On other platforms, `pathname` is an opaque sequence of bytes with no particular encoding.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,7 +5668,7 @@ pub const RealPathError = error{
5668///5668///
5669/// See also `realpathZ` and `realpathW`.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/// * On other platforms, the result is an opaque sequence of bytes with no particular encoding.5672/// * On other platforms, the result is an opaque sequence of bytes with no particular encoding.
5673///5673///
5674/// Calling this function is usually a bug.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,7 +5745,7 @@ pub fn realpathZ(pathname: [*:0]const u8, out_buffer: *[max_path_bytes]u8) RealP
5745///5745///
5746/// Same as `realpath` except `pathname` is WTF16LE-encoded.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/// Calling this function is usually a bug.5750/// Calling this function is usually a bug.
5751pub fn realpathW(pathname: []const u16, out_buffer: *[max_path_bytes]u8) RealPathError![]u8 {5751pub 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,7 +20,7 @@ pub const changeCurDirZ = posix.chdirZ;
20pub const GetCwdError = posix.GetCwdError;20pub const GetCwdError = posix.GetCwdError;
2121
22/// The result is a slice of `out_buffer`, from index `0`.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/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.24/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
25pub fn getCwd(out_buffer: []u8) ![]u8 {25pub fn getCwd(out_buffer: []u8) ![]u8 {
26 return posix.getcwd(out_buffer);26 return posix.getcwd(out_buffer);
...@@ -29,7 +29,7 @@ pub fn getCwd(out_buffer: []u8) ![]u8 {...@@ -29,7 +29,7 @@ pub fn getCwd(out_buffer: []u8) ![]u8 {
29pub const GetCwdAllocError = Allocator.Error || posix.GetCwdError;29pub const GetCwdAllocError = Allocator.Error || posix.GetCwdError;
3030
31/// Caller must free the returned memory.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/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.33/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
34pub fn getCwdAlloc(allocator: Allocator) ![]u8 {34pub fn getCwdAlloc(allocator: Allocator) ![]u8 {
35 // The use of max_path_bytes here is just a heuristic: most paths will fit35 // The use of max_path_bytes here is just a heuristic: most paths will fit
...@@ -139,7 +139,7 @@ pub const EnvMap = struct {...@@ -139,7 +139,7 @@ pub const EnvMap = struct {
139 /// Same as `put` but the key and value become owned by the EnvMap rather139 /// Same as `put` but the key and value become owned by the EnvMap rather
140 /// than being copied.140 /// than being copied.
141 /// If `putMove` fails, the ownership of key and value does not transfer.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 pub fn putMove(self: *EnvMap, key: []u8, value: []u8) !void {143 pub fn putMove(self: *EnvMap, key: []u8, value: []u8) !void {
144 assert(unicode.wtf8ValidateSlice(key));144 assert(unicode.wtf8ValidateSlice(key));
145 const get_or_put = try self.hash_map.getOrPut(key);145 const get_or_put = try self.hash_map.getOrPut(key);
...@@ -152,7 +152,7 @@ pub const EnvMap = struct {...@@ -152,7 +152,7 @@ pub const EnvMap = struct {
152 }152 }
153153
154 /// `key` and `value` are copied into the EnvMap.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 pub fn put(self: *EnvMap, key: []const u8, value: []const u8) !void {156 pub fn put(self: *EnvMap, key: []const u8, value: []const u8) !void {
157 assert(unicode.wtf8ValidateSlice(key));157 assert(unicode.wtf8ValidateSlice(key));
158 const value_copy = try self.copy(value);158 const value_copy = try self.copy(value);
...@@ -171,7 +171,7 @@ pub const EnvMap = struct {...@@ -171,7 +171,7 @@ pub const EnvMap = struct {
171171
172 /// Find the address of the value associated with a key.172 /// Find the address of the value associated with a key.
173 /// The returned pointer is invalidated if the map resizes.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 pub fn getPtr(self: EnvMap, key: []const u8) ?*[]const u8 {175 pub fn getPtr(self: EnvMap, key: []const u8) ?*[]const u8 {
176 assert(unicode.wtf8ValidateSlice(key));176 assert(unicode.wtf8ValidateSlice(key));
177 return self.hash_map.getPtr(key);177 return self.hash_map.getPtr(key);
...@@ -180,7 +180,7 @@ pub const EnvMap = struct {...@@ -180,7 +180,7 @@ pub const EnvMap = struct {
180 /// Return the map's copy of the value associated with180 /// Return the map's copy of the value associated with
181 /// a key. The returned string is invalidated if this181 /// a key. The returned string is invalidated if this
182 /// key is removed from the map.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 pub fn get(self: EnvMap, key: []const u8) ?[]const u8 {184 pub fn get(self: EnvMap, key: []const u8) ?[]const u8 {
185 assert(unicode.wtf8ValidateSlice(key));185 assert(unicode.wtf8ValidateSlice(key));
186 return self.hash_map.get(key);186 return self.hash_map.get(key);
...@@ -188,7 +188,7 @@ pub const EnvMap = struct {...@@ -188,7 +188,7 @@ pub const EnvMap = struct {
188188
189 /// Removes the item from the map and frees its value.189 /// Removes the item from the map and frees its value.
190 /// This invalidates the value returned by get() for this key.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 pub fn remove(self: *EnvMap, key: []const u8) void {192 pub fn remove(self: *EnvMap, key: []const u8) void {
193 assert(unicode.wtf8ValidateSlice(key));193 assert(unicode.wtf8ValidateSlice(key));
194 const kv = self.hash_map.fetchRemove(key) orelse return;194 const kv = self.hash_map.fetchRemove(key) orelse return;
...@@ -387,14 +387,14 @@ pub const GetEnvVarOwnedError = error{...@@ -387,14 +387,14 @@ pub const GetEnvVarOwnedError = error{
387 EnvironmentVariableNotFound,387 EnvironmentVariableNotFound,
388388
389 /// On Windows, environment variable keys provided by the user must be valid WTF-8.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 InvalidWtf8,391 InvalidWtf8,
392};392};
393393
394/// Caller must free returned memory.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/// then `error.InvalidWtf8` is returned.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/// On other platforms, the value is an opaque sequence of bytes with no particular encoding.398/// On other platforms, the value is an opaque sequence of bytes with no particular encoding.
399pub fn getEnvVarOwned(allocator: Allocator, key: []const u8) GetEnvVarOwnedError![]u8 {399pub fn getEnvVarOwned(allocator: Allocator, key: []const u8) GetEnvVarOwnedError![]u8 {
400 if (native_os == .windows) {400 if (native_os == .windows) {
...@@ -469,11 +469,11 @@ pub const HasEnvVarError = error{...@@ -469,11 +469,11 @@ pub const HasEnvVarError = error{
469 OutOfMemory,469 OutOfMemory,
470470
471 /// On Windows, environment variable keys provided by the user must be valid WTF-8.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 InvalidWtf8,473 InvalidWtf8,
474};474};
475475
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/// then `error.InvalidWtf8` is returned.477/// then `error.InvalidWtf8` is returned.
478pub fn hasEnvVar(allocator: Allocator, key: []const u8) HasEnvVarError!bool {478pub fn hasEnvVar(allocator: Allocator, key: []const u8) HasEnvVarError!bool {
479 if (native_os == .windows) {479 if (native_os == .windows) {
...@@ -491,7 +491,7 @@ pub fn hasEnvVar(allocator: Allocator, key: []const u8) HasEnvVarError!bool {...@@ -491,7 +491,7 @@ pub fn hasEnvVar(allocator: Allocator, key: []const u8) HasEnvVarError!bool {
491 }491 }
492}492}
493493
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/// then `error.InvalidWtf8` is returned.495/// then `error.InvalidWtf8` is returned.
496pub fn hasNonEmptyEnvVar(allocator: Allocator, key: []const u8) HasEnvVarError!bool {496pub fn hasNonEmptyEnvVar(allocator: Allocator, key: []const u8) HasEnvVarError!bool {
497 if (native_os == .windows) {497 if (native_os == .windows) {
...@@ -737,7 +737,7 @@ pub const ArgIteratorWindows = struct {...@@ -737,7 +737,7 @@ pub const ArgIteratorWindows = struct {
737737
738 /// Returns the next argument and advances the iterator. Returns `null` if at the end of the738 /// Returns the next argument and advances the iterator. Returns `null` if at the end of the
739 /// command-line string. The iterator owns the returned slice.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 pub fn next(self: *ArgIteratorWindows) ?[:0]const u8 {741 pub fn next(self: *ArgIteratorWindows) ?[:0]const u8 {
742 return self.nextWithStrategy(next_strategy);742 return self.nextWithStrategy(next_strategy);
743 }743 }
...@@ -771,7 +771,7 @@ pub const ArgIteratorWindows = struct {...@@ -771,7 +771,7 @@ pub const ArgIteratorWindows = struct {
771 // check to see if we've emitted two consecutive surrogate771 // check to see if we've emitted two consecutive surrogate
772 // codepoints that form a valid surrogate pair in order772 // codepoints that form a valid surrogate pair in order
773 // to ensure that we're always emitting well-formed WTF-8773 // 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 // If we do have a valid surrogate pair, we need to emit776 // If we do have a valid surrogate pair, we need to emit
777 // the UTF-8 sequence for the codepoint that they encode777 // the UTF-8 sequence for the codepoint that they encode
...@@ -1196,7 +1196,7 @@ pub const ArgIterator = struct {...@@ -1196,7 +1196,7 @@ pub const ArgIterator = struct {
11961196
1197 /// Get the next argument. Returns 'null' if we are at the end.1197 /// Get the next argument. Returns 'null' if we are at the end.
1198 /// Returned slice is pointing to the iterator's internal buffer.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 /// On other platforms, the result is an opaque sequence of bytes with no particular encoding.1200 /// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
1201 pub fn next(self: *ArgIterator) ?([:0]const u8) {1201 pub fn next(self: *ArgIterator) ?([:0]const u8) {
1202 return self.inner.next();1202 return self.inner.next();
...@@ -1234,7 +1234,7 @@ pub fn argsWithAllocator(allocator: Allocator) ArgIterator.InitError!ArgIterator...@@ -1234,7 +1234,7 @@ pub fn argsWithAllocator(allocator: Allocator) ArgIterator.InitError!ArgIterator
1234}1234}
12351235
1236/// Caller must call argsFree on result.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/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.1238/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
1239pub fn argsAlloc(allocator: Allocator) ![][:0]u8 {1239pub fn argsAlloc(allocator: Allocator) ![][:0]u8 {
1240 // TODO refactor to only make 1 allocation.1240 // TODO refactor to only make 1 allocation.
lib/std/process/Child.zig+1-1
...@@ -162,7 +162,7 @@ pub const SpawnError = error{...@@ -162,7 +162,7 @@ pub const SpawnError = error{
162 NoDevice,162 NoDevice,
163163
164 /// Windows-only. `cwd` or `argv` was provided and it was invalid WTF-8.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 InvalidWtf8,166 InvalidWtf8,
167167
168 /// Windows-only. `cwd` was provided, but the path did not exist when spawning the child process.168 /// Windows-only. `cwd` was provided, but the path did not exist when spawning the child process.