4 ms·
> But linux filename basically allows any byte sequence except EOF and / (...) Could/should/would... Even though UNIX doesn't impose many restrictions on file
by barumi 6y ago
> But linux filename basically allows any byte sequence except EOF and / (...)
Could/should/would...
Even though UNIX doesn't impose many restrictions on file names that doesn't mean it's in your best interests to use any weird character in them.
I mean, do you honestly believe it's a good idea to have file names that are 256-characters long, have line breaks in their name, and have substrings such as "sudo rm -rf /"?
- dan00 6y agoThe point isn’t if it’s a good idea, but that a program shouldn’t misbehave.
- maple3142 6y ago> I mean, do you honestly believe it's a good idea to have file names that are 256-characters long, have line breaks in their name, and have substrings such as "sudo rm -rf /"? Yes. It is usually some badly written programs or scripts choke on space, newline other things. BTW, I would like to impose a restriction that filename must be valid UTF-8 string instead of random bytes.