Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling of Windows system file status broken since 1.79.0 #234

Closed
MarcelRaad opened this issue May 4, 2022 · 5 comments
Closed

Handling of Windows system file status broken since 1.79.0 #234

MarcelRaad opened this issue May 4, 2022 · 5 comments

Comments

@MarcelRaad
Copy link
Contributor

MarcelRaad commented May 4, 2022

Since commit 97722a3, calls like these fail on Windows 10:
boost::filesystem::is_directory(L"C:\\System Volume Information")
boost::filesystem::is_symlink(L"C:\\DumpStack.log")

This is because CreateFileW now fails with ERROR_ACCESS_DENIED, while the previously used GetFileAttributesW succeeded.

@Lastique
Copy link
Member

Lastique commented May 9, 2022

Note that std::filesystem::symlink_status also returns "Access denied" for "C:\System Volume Information". std::filesystem::status succeeds. I'm not sure I like this kind of inconsistency.

@MarcelRaad
Copy link
Contributor Author

I can confirm that the patch works great. Thanks a lot!

@TMeindl
Copy link

TMeindl commented Aug 29, 2022

FYI: This does still not work when the directory is on a usb device; i.e. when a USB Device is for example mounted on drive H and has a valid directory with the name "source":
boost::filesystem::is_directory("H:\source") --> false
std::filesystem::is_directory("H:\source") --> true

@Lastique
Copy link
Member

Lastique commented Aug 29, 2022

What filesystem is H:? What Windows version? Can you debug this case?

Assuming that you're not passing an error_code and there is no exception, WinAPI calls don't fail in your case, so this is not the same issue as the one that was originally reported here. Please open a new issue with all additional information you find.

@TMeindl
Copy link

TMeindl commented Aug 30, 2022

Ah, sorry, there where other changes in the operations.cpp file; I just used this patch for testing. I can confirm that with boost version 1.80 boost::filesystem::is_directory() works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants