I thought this would have been asked a million times already, but my search didn't turn up anything.
Can I safely use an email address as a linux directory name? In other words is any valid email address also a valid directory name? If not are there any characters in particular that I would have to filter first?
An empty string is the only truly invalid path name on Linux, which may work for you if you need only one invalid name. You could also use a string like " ///foo ", which would not be a canonical path name, although it could refer to a file (" /foo ").
A valid email address consists of an email prefix and an email domain, both in acceptable formats. The prefix appears to the left of the @ symbol. The domain appears to the right of the @ symbol. For example, in the address [email protected], "example" is the email prefix, and "mail.com" is the email domain.
No, almost.
The '/'
character is allowed in emails (http://en.wikipedia.org/wiki/Email_address#Syntax) but not in linux filenames.
See SO Answer here: Are there any invalid linux filenames?
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