zig/lib/std/fs
Amir Alawi 4cbf74bd9b
fix std.fs.Dir.makePath silent failure (#16878)
std.fs.dir.makePath silently failed if one of the items in the path already exists. For example:

cwd.makePath("foo/bar/baz")
Silently failing is OK if "bar" is already a directory - this is the intended use of makePath (like mkdir -p). But if bar is a file then the subdirectory baz cannot be created - the end result is that makePath doesn't do anything which should be a detectable error because baz is never created.

The existing code had a TODO comment that did not specifically cover this error, but the solution for this silent failure also accomplishes the TODO task - the code now stats "foo" and returns an appropriate error. The new code also handles potential race condition if "bar" is deleted/permissions changed/etc in between the initial makeDir and statFile calls.
2024-01-08 15:58:14 -05:00
..
AtomicFile.zig frontend: ignore AccessDenied when writing builtin.zig 2024-01-01 19:49:08 -07:00
Dir.zig fix std.fs.Dir.makePath silent failure (#16878) 2024-01-08 15:58:14 -05:00
File.zig Merge pull request #18326 from squeek502/stat-symlink 2023-12-22 12:06:10 +02:00
get_app_data_dir.zig Replace shell32.SHGetKnownFolderPath usage with LOCALAPPDATA env var 2023-11-23 01:11:53 -08:00
path.zig std.builtin.Endian: make the tags lower case 2023-10-31 21:37:35 -04:00
test.zig fix std.fs.Dir.makePath silent failure (#16878) 2024-01-08 15:58:14 -05:00
wasi.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
watch.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00