4 ms·
What do you expect to happen when your cloud storage file path is 5000 characters long and your local filesystem only supports a maximum of 4096?
by dns_snek 6mo ago
What do you expect to happen when your cloud storage file path is 5000 characters long and your local filesystem only supports a maximum of 4096?
- jamesfinlayson 6mo agoOh yeah... I remember Windows behaving weirdly when I tried to copy some files with long names into a deeper directory tree. And it was just weird behaviour - no useful error message.
- fluoridation 6mo agoWindows in particular supports at the API level paths tens of thousands of characters long, much longer than Linux. The problem is applications need to explicitly support such paths using the long path syntax, otherwise they're limited to 255 characters.
- jamesfinlayson 6mo agoYeah I thought there was some way of doing it, but weirdly it was explorer.exe that was behaving in odd ways.
- sunnybeetroot 6mo agoGreat point I stand corrected
- zrm 6mo agoYou expect the files to still be accessible using relative paths. What do you expect to happen if your cloud storage file path is 50 characters long and is mounted in a folder which is 4050 characters long when PATH_MAX is 4096? The sync application itself can handle this using openat(2) or similar and should probably be using that regardless to avoid races.
- dns_snek 6mo agoAh, I forgot that the maximum path length is usually limited by PATH_MAX, it's the path segment that's usually limited by the filesystem. Point taken, although I still think it's better for cloud storage services to err on the side of compatibility, i.e. what's the lowest common denominator between Linux, macOS, Android, iOS from 10 years ago and Windows 7?