Consider a Save As dialog with a free text entry where the user enters a file name as free text, then clicks a Save button. The software then validates the file name, and saves the file if the name is valid.
On a Unix file system, what rules should be applied in the validation such that:
So basically, what is the minimum set of characters that should be restricted from a Unix file name?
Under Linux and other Unix-related systems, there are only two characters that cannot appear in the name of a file or directory, and those are NUL '\0' and slash '/' .
You cannot use the null character. No need to use . (dot) in a filename. Some time dot improves readability of filenames.
The minimum are slash ('/') and NULL ('\0')
Firstly, what you're describing is black listing. Your better option is to white list your characters, as it is easier (from a user perspective) to have characters inserted rather than taken away.
In terms of what would be good in a unix environment:
_
)-
).
)Should cover your basics. Spaces can be okay, but make things difficult. Windows users love them, unix/linux don't. So depending on your target audience choose accordingly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With