file name too long

I saved a website which get quite a long filename due to its long title. The file name has 188 characters.

The file isn’t sync’ed and Syncthing throws the INFO message: file name too long.

Is there a limit?

juh

It depends on the length of the complete path to the file (such as C:\Program Files\filename.txt). Windows limits a single path to 260 characters. This is why you might occasionally get an error when copying a file with a very long file name to a location that has a longer path than the file’s original location.

Source

What @uok said. The “filename” really means filename+path. Remember to count all of the directories including the filename.

Mh, it’s a file on Mac OS X which cannot be sync’ed to linux. If the limit on linux is 255 bytes that might be the reason. The file name with all path infos is 242 characters long.

Linux has higher limits. Usually 255 bytes per path component, 4096 bytes for the entire path. Note though that “188 characters” is not necessarily “188 bytes”. If those characters are Chinese, you probably have about 188 * 3 = 564 bytes in UTF8, which exceeds the 255 byte limit.

On Windows you has also GetLongPathNameW and you has 32,767 Characters ( \\?\ prefix)

A working workaround is to set the folder path to something like \\?\c:\my\folder\path, i.e. prefix it with \\?\.

Closed for apparently being a spam magnet topic (also, correctly diagnosed and worked around).