Skip to main content
added 590 characters in body
Source Link
l0b0
  • 53.6k
  • 48
  • 225
  • 398

On most Linux filesystems, NUL (\0) is the only invalid character in paths (and / is reserved as the path separator). Windows has a complicated set of rules for valid paths. Rather than fixing paths automagically (dangerous, could result in a file overwriting another), how can I find all paths within a directory not compatible with Windows?

The original issue was that my Google Drive folder was on a drive mounted using ext2fs, but the official Gdrive client told me thousands of files could not be synced. I could find no error messages, and when I asked it to show me the files it would simply hang indefinitely. Restarting the client or OS did not help, but I had a hunch fixing any non-Windows-compatible paths would unstick Gdrive. It seems to have worked...

On most Linux filesystems, NUL (\0) is the only invalid character in paths (and / is reserved as the path separator). Windows has a complicated set of rules for valid paths. Rather than fixing paths automagically (dangerous, could result in a file overwriting another), how can I find all paths within a directory not compatible with Windows?

On most Linux filesystems, NUL (\0) is the only invalid character in paths (and / is reserved as the path separator). Windows has a complicated set of rules for valid paths. Rather than fixing paths automagically (dangerous, could result in a file overwriting another), how can I find all paths within a directory not compatible with Windows?

The original issue was that my Google Drive folder was on a drive mounted using ext2fs, but the official Gdrive client told me thousands of files could not be synced. I could find no error messages, and when I asked it to show me the files it would simply hang indefinitely. Restarting the client or OS did not help, but I had a hunch fixing any non-Windows-compatible paths would unstick Gdrive. It seems to have worked...

edited tags
Link
Gilles 'SO- stop being evil'
  • 865.3k
  • 205
  • 1.8k
  • 2.3k
Tweeted twitter.com/#!/StackUnix/status/470331469424902144
Source Link
l0b0
  • 53.6k
  • 48
  • 225
  • 398

How to find all paths not compatible with Windows?

On most Linux filesystems, NUL (\0) is the only invalid character in paths (and / is reserved as the path separator). Windows has a complicated set of rules for valid paths. Rather than fixing paths automagically (dangerous, could result in a file overwriting another), how can I find all paths within a directory not compatible with Windows?