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

std::filesystem::canonical converts the mapped network drive to network path #5327

Open
atulrawat951 opened this issue Mar 7, 2025 · 1 comment
Labels
filesystem C++17 filesystem question Further information is requested

Comments

@atulrawat951
Copy link

or the below code:

std::error_code ec; auto long_path = std::filesystem::canonical("W:\\31\\arawat.fielsystem_default_check\\matlab\\check_std\\check_std\\").string();

I am getting the value of long path as:

"\\\\bgl-zp31-cifs\\vmgr\\sbs31\\arawat.fielsystem_default_check\\matlab\\check_std\\check_std"

std::filesystem::canonical is converting the path to a network path. Is there any way to prevent it or get the original drive letter path back from a network path.

@atulrawat951 atulrawat951 added the question Further information is requested label Mar 7, 2025
@StephanTLavavej StephanTLavavej added the filesystem C++17 filesystem label Mar 10, 2025
@StephanTLavavej
Copy link
Member

StephanTLavavej commented Mar 12, 2025

We're calling GetFinalPathNameByHandleW so I'm unsure whether what you want is achievable via the Windows API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filesystem C++17 filesystem question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants