JUCE
JUCE copied to clipboard
[Bug]: File operations fail for long paths on Windows
Detailed steps on how to reproduce the bug
I used RangedDirectoryIterator() to iterate over a directory with a file whose full path name is longer than MAX_PATH. That worked properly, but the returned File object isn't functional, e.g., existsAsFile() returns false, and reading fails.
A workaround is to create a new File object, prefixing the path name with \\?\.
This was apparently also encountered by multiple users in the forum.
What is the expected behaviour?
Deal with long filenames
Note: On new enough versions of Windows this can apparently be handled without prefixing \\?\ everywhere, by adding a manifest. That's a good enough solution IMHO. At least it would solve 80% of the limitation possibly with 20% of the work.
Operating systems
Windows
What versions of the operating systems?
all
Architectures
64-bit
Stacktrace
No response
Plug-in formats (if applicable)
No response
Plug-in host applications (DAWs) (if applicable)
No response
Testing on the develop branch
The bug is present on the develop branch
Code of Conduct
- [X] I agree to follow the Code of Conduct