3 ms·
Linux will allow anything as a valid file name. Including slashes, colons, new line characters and even none-printable characters. Usually GUIs filter will catc
by pushpop 7y ago
Linux will allow anything as a valid file name. Including slashes, colons, new line characters and even none-printable characters. Usually GUIs filter will catch the worst offenders but it’s less of an issue on the CLI because you can escape all of those weird characters pretty easily (at least it’s easy once you know how. There is a little bit of a discoverability problem there though).
Windows, on the other hand, not only has special characters that cannot be used but also reserved words that cannot be used as file names (eg COM). Then there’s the issue with magic file extensions and even Windows Explorer hiding extensions entirely by default.
On balance I prefer Linux’s approach. Sure it creates some problems but they’re easy to be worked around and usually only rear their head when you start using lesser polished UIs or shared file systems with Windows. Plus Linux empowers you to use those names if needed, or change them if it’s a problem. Whereas Windows has these weird hidden show stoppers - many of which were only relevant in the days of DOS but have been carried forward in every iteration of Windows since (including NT) for compatibility reasons. That causes way more problems to developers - which is my personal use case.
- type0 7y agoThanks for clarification, haven't realized until now that some of my previous problems with Windows might have been the result of hard-coded characters and those reserved name gotchas. https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file https://docs.microsoft.com/en-us/windows/desktop/fileio/nami...
- Nomentatus 7y agoNo warning, no opting out - that's a huge problem. It means you absolutely should not mix these two OSes.
- pushpop 7y agoI don’t see a problem mixing those two OSs if that’s what you really want to do. If we’re honest, it’s pretty edge case stuff we are talking about and most users experienced enough to be mixing Windows and Linux systems would be aware of the limitations of Windows when it comes to naming things. Granted the reserved namespace problem, COM1 et al, is far less discoverable; but it’s also far less common of a trap. So it’s not something that comes up that often if your team are aware of the problems. Worst scenario is you’re dealing with a non-technical team but in those instances you’d keep your storage centralised and use an NT based solution (or something with first party support for AD) so you catch any Windows related bugs at save time rather than further down the road when you need to access them again. Given file names in Windows is limited by both the file system and the OS, whereas Linux is limited only by the file system, all you really need to do is catch those Windows-related errors. So running an NT-based storage array would solve that problem.
- Nomentatus 7y agoTrue, if you're big enough you can insert a filter - which only underlines the question - why isn't there a filter available to begin with?