Skip to content

<filesystem>: Does it naturally support all functions with a long path (>260) on Windows? #1921

Closed
@eric-zheng

Description

@eric-zheng

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?
  • 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.
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requestedresolvedSuccessfully resolved without a commit

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions