Open hasufell opened 2 years ago
ping @Mistuke
Ah I missed this, I'm on holiday atm and will do it when I'm back in two weeks.
The comment in the struct for dwFileType
seem to say:
Obsolete. Do not use
What else do we use without incurring another syscall?
The comment in the struct for
dwFileType
seem to say:Obsolete. Do not use
Those entries never existed on Windows. This is a documentation bug, if you look in the windows sdk headers, they're guarded by _MAC
. i.e. they only ever worked on MACOS from the early days of Microsoft and Apple.
It's just that MSDN seems to render them that way. the mingw-w64 headers for instance don't even contain them
https://github.com/Alexpux/mingw-w64/blob/master/mingw-w64-headers/include/minwinbase.h#L61
What else do we use without incurring another syscall?
It's not entirely clear to me what dwFileType
actually contained.. Is what you're after in https://learn.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants? i.e. dwFileAttributes
.
If dwFileAttributes
allows us to determine the file type, then that will be enough.
Expose
FindData
struct: https://docs.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-win32_find_dataaOtherwise it's hard to determine file-type efficiently when using
findFirstFile
/findNextFile
: https://hackage.haskell.org/package/Win32-2.13.2.0/docs/System-Win32-File.html#v:findFirstFile