3 ms·
Why would you make such assumptions? On Unix systems there is one and only one byte value that cannot appear in a directory or file name: ASCII '/'. Note that
by cryptonector 8y ago
Why would you make such assumptions?
On Unix systems there is one and only one byte value that cannot appear in a directory or file name: ASCII '/'. Note that I say "byte value": the kernel and the filesystem driver have NO idea what local you're using in user-land, and they don't care.
On Windows both '/' and '\' cannot appear, though as we can see here, ':' and others are problematic...
In shell scripts you really have to quote every damned string. I really wish that instead of by default splitting words on $IFS and interpreting glob and other shell special characters, the default was that $varname has no such handling performed, and instead if you wish for this you'd have to write ${varname*} or something like that.
- mehrdadn 8y agoBecause I'm talking about Windows and not Unix systems, and on for Windows systems, literally every piece of documentation I've seen has said that * < > : / etc. are invalid name characters.
- cryptonector 8y agoStill, quote everything. Whitespace and other special characters are still a problem if you don't.
- JdeBP 8y agoNTFS and the Native API had to support operating system personalities where these were perfectly legitimate characters to have in filenames, right from the start. It is the personalities like Win32 and 16-bit OS/2 that introduce the extra limitations.