windows: FILE_DISPOSITION_POSIX_SEMANTICS
is not supported on FAT filesystems
#16497
Labels
bug
Observed behavior contradicts documented or intended behavior
os-windows
standard library
This issue involves writing Zig code for the standard library.
Milestone
Zig Version
0.11.0-dev.4059+17255bed4
Steps to Reproduce and Observed Behavior
#15501 made
std.os.windows.DeleteFile
useNtSetInformationFile
withFILE_DISPOSITION_POSIX_SEMANTICS
ifbuiltin.target.os.version_range.windows.min.isAtLeast(.win10_rs1)
.However, this flag is only supported if the underlying filesystem is NTFS. On FAT filesystems, calling
NtSetInformationFile
withFILE_DISPOSITION_POSIX_SEMANTICS
results inSTATUS_INVALID_PARAMETER
:To avoid this, it should be possible to use
NtQueryVolumeInformationFile
before theNtSetInformationFile
instd.os.windows.DeleteFile
withFileFsAttributeInformation
/FILE_FS_ATTRIBUTE_INFORMATION
. TheFileSystemAttributes
can then be checked forFILE_SUPPORTS_POSIX_UNLINK_RENAME
.Tested to make sure the
FILE_SUPPORTS_POSIX_UNLINK_RENAME
flag works the expected way using the higher level Windows APIs in C:On NTFS:
On FAT:
Expected Behavior
std.fs
delete APIs to work on FAT filesystems on WindowsThe text was updated successfully, but these errors were encountered: