Description
Long Path Support (>260 Characters) with MSVC STL <filesystem>
Hello, I'm filing this issue to ask about the information of Windows Long Path Support in the <filesystem>
STL.
Traditionally, Windows doesn't support long path (>260 characters) before Windows 10, version 1607. This was explained here.
There was no information on the Internet about whether the current implementation of <filesystem>
supports long paths. I have checked the <filesystem>
documentation and searched on Google. The only related information I found was this and this. But they are relatively old because this repo went to public in 2019.
Traditionally, msvc's STL before <filesystem>
didn't support long paths. However, when I looked into the implementation of <filesystem>
, I think it does use the OS API supporting long paths. So just to confirm what I found, I have a few questions:
- Does the current
<filesystem>
support long paths on Windows?- If so, what is the minimum version of msvc compiler supporting that?
- Whether all functions/classes of
<filesystem>
support long paths?- I asked this because I don't see this behavior is verified in the tests: I only saw a few usage of
longSuffix
in https://github.com/microsoft/STL/blob/main/tests/std/tests/P0218R1_filesystem/test.cpp. And they are not covering major functionalities.
- I asked this because I don't see this behavior is verified in the tests: I only saw a few usage of
- Whether people need to manually convert a path to its UNC form in order to make
<filesystem>
support long paths? Or does<filesystem>
convert the long path to its UNC path for users automatically?- i.e. what people should do in order to utilize
<filesystem>
to support windows long paths. It would be good to have a simple example/tutorial.
- i.e. what people should do in order to utilize
- Since
<filesystem>
only handles file operations, I was wondering if the file I/O of the current STL also supports long paths.- i.e. whether the C API or stream libraries support file open/read/write with a long path?
Finally, it would be really great if the documentation of <filesystem>
can add more information about long path support.
Thanks a lot!
Eric