-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioros-windowsstandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Milestone
Description
When ./dir is non-empty, the following code will succeed but the directory will not be deleted. I expect error.DirNotEmpty to be returned in this case.
const std = @import("std");
pub fn main() !void {
return std.fs.cwd().deleteDir("dir");
}Both NtCreateFile and NtClose seem to be returning SUCCESS here:
Lines 1768 to 1791 in fd067fb
| var rc = w.ntdll.NtCreateFile( | |
| &tmp_handle, | |
| w.SYNCHRONIZE | w.DELETE, | |
| &attr, | |
| &io, | |
| null, | |
| 0, | |
| w.FILE_SHARE_READ | w.FILE_SHARE_WRITE | w.FILE_SHARE_DELETE, | |
| w.FILE_OPEN, | |
| create_options_flags, | |
| null, | |
| 0, | |
| ); | |
| if (rc == .SUCCESS) { | |
| rc = w.ntdll.NtClose(tmp_handle); | |
| } | |
| switch (rc) { | |
| .SUCCESS => return, | |
| .OBJECT_NAME_INVALID => unreachable, | |
| .OBJECT_NAME_NOT_FOUND => return error.FileNotFound, | |
| .INVALID_PARAMETER => unreachable, | |
| .FILE_IS_A_DIRECTORY => return error.IsDir, | |
| else => return w.unexpectedStatus(rc), | |
| } |
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioros-windowsstandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.