-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Description
Test code:
const std = @import("std");
pub fn main() !void {
if (std.fs.cwd().createFile("file.txt", .{})) |file| {
file.close();
} else |err| switch (err) {
error.PathAlreadyExists => {},
else => return err,
}
// this should fail, but instead it succeeds and deletes file.txt
return std.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:
const std = @import("std");
pub fn main() !void {
// this should fail, but instead it succeeds and deletes file.txt
return std.fs.cwd().deleteDir("file.txt");
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels