juce-framework / JUCE

JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, LV2 and AAX audio plug-ins.
https://juce.com
Other
6.3k stars 1.67k forks source link

[Bug]: File operations fail for long paths on Windows #1356

Open danra opened 4 months ago

danra commented 4 months ago

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