4 ms·
Filenames containing whitespace are, and always have been, a bloody stupid idea.
by milesrout 10y ago
Filenames containing whitespace are, and always have been, a bloody stupid idea.
- rocqua 10y agoNo, assuming filenames dont have whitespace is an idea that has fucked over people for a long time. Sure, it's annoying in a shell when whitespace is used as a separator but that seems more of an issue with shells than with filenames. Filenames should describe the file. In language, descriptions quite often require whitespace.
- milesrout 10y agoWhitespace should have been banned from filenames decades ago. If you need 'whitespace', use a hyphen or an underscore.
- oneeyedpigeon 10y agoI agree, if you ever want whitespace to have any special meaning in your shell (and you do), allowing spaces within filenames just causes no end of headaches.
- ygra 10y agoFor interactive use, tab completion already takes care of the escaping. For anything else the actual headache is that things are passed around as strings and command argument parsing is done for the expanded string where spaces can cause different argument parsing unexpectedly. This is certainly not limited to filenames but any argument that can contain spaces and is passed to a different command without proper quoting. The very fact that it's so easy to get wrong is perhaps a sign that things are a bit broken. But not necessarily at the filesystem level ...
- Khaine 10y agoNo, file names should describe the file. hyphens and underscores are hacks. Systems should be better at handling files with unicode characters and spaces. Its the fault of the shell that whitespace has been overloaded, not filenames.
- to3m 10y agoBut whitespace was banned from file names decades ago, and look what happened: people wanted it added in. So it was added in. That's progress! If the shell can't handle this well, the problem is that the shell is not very well designed, and we need something better. Meanwhile, I never have problems with spaces in file names when I'm doing stuff in C++, C#, Python, etc.
- leni536 10y agoWell they should be banned then, but they are not. Also it might be a stupid idea for regular use but not so stupid idea as an attack vector. Along with filenames starting with a dash.
- Zardoz84 10y agoBut we must live with they.