authorgravatar for suirad@users.noreply.github.comSuirad <suirad@users.noreply.github.com> 2020-09-25 18:11:31-05:00
committergravatar for suirad@users.noreply.github.comSuirad <suirad@users.noreply.github.com> 2020-09-25 18:11:31-05:00
log43cd9eb110f6803f4e19d92347ebf263e6e644af
tree9133c9adedc469176bcfd2d9ccf7f919dfddc209
parentf78652484a2bf5ee967d0ed7ca1db495932fad48

Add clarification comment


1 files changed, 3 insertions(+), 1 deletions(-)

lib/std/os/windows.zig+3-1
...@@ -828,7 +828,9 @@ pub fn DeleteFile(sub_path_w: []const u16, options: DeleteFileOptions) DeleteFil...@@ -828,7 +828,9 @@ pub fn DeleteFile(sub_path_w: []const u16, options: DeleteFileOptions) DeleteFil
828 else => return unexpectedStatus(rc),828 else => return unexpectedStatus(rc),
829 }829 }
830830
831 if (options.remove_dir){831 // If a directory fails to be deleted, CloseHandle will still report success
832 // Check if the directory still exists and return error.DirNotEmpty if true
833 if (options.remove_dir) {
832 var basic_info: FILE_BASIC_INFORMATION = undefined;834 var basic_info: FILE_BASIC_INFORMATION = undefined;
833 switch (ntdll.NtQueryAttributesFile(&attr, &basic_info)) {835 switch (ntdll.NtQueryAttributesFile(&attr, &basic_info)) {
834 .SUCCESS => return error.DirNotEmpty,836 .SUCCESS => return error.DirNotEmpty,