gulrak / filesystem

An implementation of C++17 std::filesystem for C++11 /C++14/C++17/C++20 on Windows, macOS, Linux and FreeBSD.
MIT License
1.34k stars 173 forks source link

Fix `create_directories` for windows long paths #126

Closed adriendelsalle closed 3 years ago

adriendelsalle commented 3 years ago

Description

fix create_directories for Windows long paths add a test

This is a simple proposition but I would need help/guidance if it has to be further improved! Thanks

Closes https://github.com/gulrak/filesystem/issues/125

gulrak commented 3 years ago

As written in #125, the fix for the actually broken long-filename-test and the fs::create_directories error are tricky, as the current code with the fix would still break with disabled auto-prefixing (GHC_WIN_DISABLE_AUTO_PREFIXES). As I combined the fix with some optimizations to reduce temp object generation, I tried a fix myself, also to gain deeper understanding of the problem in respect to the options.

adriendelsalle commented 3 years ago

Do you want me to close this one in favor to your fix then?

gulrak commented 3 years ago

Yeah, if you are fine with my fix.