Display warnings for paths that exceed Windows path length limit

Hello there,

So on Windows there is a limit for how long paths can get and rclone circumvents that by default. In my use case, this limit has to be respected at all costs. I modified the conf file according to the documentation and the limit is indeed respected.

One thing I would wish, though, is that the error message in the log could be changed to signify that this limit is responsible for the failed transfers. Currently the log says "The system could not find the path". The message is displayed in my language so I assume this is a standard error message from the OS.

Implementing a different error message would help to make the log clearer and differentiate between path limit errors and other errors that cause the aforementioned OS warning.

I hope my post is clear enough. If not, feel free to ask!

Rclone uses UNC paths like \\? in order to work around the standard 260 character path length for windows.

I expect you set this flag in the config

  --local-nounc string   Disable UNC (long path names) conversion on Windows

Yes this is a message direct from the OS and as a consequence rclone can't tell that the error is because the path is too long.

You might think that rclone could just count the characters in the path. However that is hard to do correctly since windows internally uses UTF-16 characters and rclone uses UTF-8 and I'd rather not get into that on the 24 different supported architectures.

I think my main question is, why do you need to turn off UNC paths?

I expect you set this flag in the config

Actually, I set this:

[nounc]
type = local
nounc = true

I assume this is just a different notation for what you wrote. I took it from the local file system documentation.

I understand that very well, having dealt with issues around handling different encodings in the past. I'd just like to ask: I don't understand what you mean with 24 different supported architectures. Wouldn't this just be for Windows? I assume it has to do with the way the rclone project is written and developed but I don't understand much about that.

We were warned of this on several occasions by people who understand more about Windows and IT in general. The wording was something along the lines of "you can only do that for so long before there's trouble" but I didn't ask what kind of trouble UNC paths could possibly cause.

Our main concern is to keep 100% of files fully readable and processable. It's archive material so we cannot afford any buggy behavior from any software that we use. Files stored with UNC paths are not readable by some programs so that scared me off using UNC paths.

As to this feature request, I programmed a GUI for my colleagues and if the log shows the "system could not find the path" message, I display a warning that not everything was transferred and that some of the path lengths were likely responsible. This is acceptable and if the feature is not easily implemented I think we can scrap it. :slight_smile:

Yes that is a possibility to just put the warning in for the Windows OS.

I'm not aware of this, but I'm not a Windows expert.

I think what it means is that old programs that expect the 260 char limit to be in place can't read file paths longer than 260 chars. Given that UNC paths have been around since Windows NT and fully supported in Windows XP there shouldn't be much software around which chokes on a 260 char path length. Then again there might be!

I'll just note I haven't had any feedback from users that the UNC paths are causing a problem. The most common feedback is that the individual path sizes in the UNC path (255 bytes) are too short!