Open snullp opened 1 year ago
Hi @snullp ,
That seems to be a good and quick idea to implement. Thanks for the suggestion!
Would need to populate the \\?\UNC
prefix in gRootDirectory
when the arg starts with \
(UNC).
https://github.com/dokan-dev/dokany/blob/master/samples/dokan_mirror/mirror.c#L1596-L1603
Thank you @Liryna . I also found out that rclone does the same: https://rclone.org/local/#long-paths
In latest Windows 10 there is a peculiar behavior over network path relating to long file path. This is not associated with the long file path flag in mirror.c (thanks for enabling it by default), and I already enabled long file path support in Win10 registry (long path in local drive works).
For the network share paths with a long path name, instead of using
\\server_name\long\path\to\file
, Win 10 uses\\?\UNC\server_name\long\path\to\file
. Windows Explorer does this conversion automatically: When navigating into a long path folder, the location bar converts to the\\?\UNC\
format.mirror.exe does not to this automatically and when invoked in this form:
mirror.exe /l \\server_name\share /l D
Files with short file path can be retrieved successfully, but upon long file path files the mounted fs throws File Not Found error (I did not take screenshot or copy the log when this occurs, and now I'm running the fixed cmd below so unable to reproduce).
Manually changing cmd to the following fixes the problem:
mirror.exe /l \\?\UNC\server_name\share /l D
It would be better if mirror.exe uses the prefix automatically to avoid future user spend hours debugging like I did.