You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows: std.fs.Dir.deleteDir() will delete files #5536
conststd=@import("std");
pubfnmain() !void {
if (std.fs.cwd().createFile("file.txt", .{})) |file| {
file.close();
} else|err|switch (err) {
error.PathAlreadyExists=> {},
else=>returnerr,
}
// this should fail, but instead it succeeds and deletes file.txtreturnstd.fs.cwd().deleteDir("file.txt");
}
I expect the above to return error.NotDir, but instead it just deletes the file.
Even more minimal example has the same behaviour, assuming file.txt already exists:
conststd=@import("std");
pubfnmain() !void {
// this should fail, but instead it succeeds and deletes file.txtreturnstd.fs.cwd().deleteDir("file.txt");
}
Activity
Windows: Fix std.fs.Dir.deleteDir() deleting files
Windows: Fix std.fs.Dir.deleteDir() deleting files