Andrew Kelley Details Message ID <cce3fc5d-1f1c-be26-4fa4-6456a2bb52b5@ziglang.org> DKIM signature missing Download raw message

Standard library users, Please be aware of this commit: [breaking: improve std.fs directory handling API](https://github.com/ziglang/zig/commit/5b1a492012241276a4b7539ca6664234f0629c79) I have reproduced the commit message here: * Added `std.c.unlinkat` and `std.os.unlinkat`. * Removed `std.fs.MAX_BUF_BYTES` (this declaration never made it to master branch) * Added `std.fs.Dir.deleteTree` to be used on an open directory handle. * `std.fs.deleteTree` has better behavior for both relative and absolute paths. For absolute paths, it opens the base directory and uses that handle for subsequent operations. For relative paths, it does a similar strategy, using the cwd handle. * The error set of `std.fs.deleteTree` is improved to no longer have these possible errors: - OutOfMemory - FileTooBig - IsDir - DirNotEmpty - PathAlreadyExists - NoSpaceLeft * The error set of `std.Dir.open` is improved to no longer have these possible errors: - FileTooBig - IsDir - NoSpaceLeft - PathAlreadyExists - OutOfMemory * Added more alternative functions to `std.fs` for when the path parameter is a null terminated string. This can sometimes be more efficient on systems which have an ABI based on null terminated strings. * Added `std.fs.Dir.openDir`, `std.fs.Dir.deleteFile`, and `std.fs.Dir.deleteDir` which all operate on an open directory handle. * `std.fs.Walker.Entry` now has a `dir` field, which can be used to do operations directly on `std.fs.Walker.Entry.basename`, avoiding `error.NameTooLong` for deeply nested paths. * Added more docs to `std.os.OpenError` * Added `std.fs.Dir.cwd()` This commit was merged into master as part of e839250c5156d438f76e7b08e7053e9087fae77c (Merge branch 'stratact-no-dir-allocators'). Thank you stratact for the initial implementation in this branch to make directory handling functions no longer require allocator parameters. I took the branch even further and solved [#2888](https://github.com/ziglang/zig/issues/2888), which was notably interesting on Windows as it uses the Process Environment Block, NtCreateFile, and NtQueryDirectoryFile. During this process I discovered that the stdin, stderr, stdout, command line, environment variables, cwd path name, cwd handle, and self exe path name are all available to Windows applications without any DLL calls. This will allow many of the std lib APIs to have the possibility of failure removed! Also notable is that the x86_64-windows std lib tests can no longer be tested with wine until [this wine bug](https://bugs.winehq.org/show_bug.cgi?id=47979) is fixed. The zig tracking issue for this is https://github.com/ziglang/zig/issues/3500. There is a semi-related issue regarding the ".." directory, which you can read about here: https://github.com/ziglang/zig/issues/3501 Happy hacking, Andrew