How come you can put a question mark in file names?

In Windows, you can't put a ? in a file or directory name, because they are reserved characters for PHP GET functions and wildcards. But in Ubuntu, I can. I can name a file lol?.txt and access it properly like any other file. How come you can do this safely in Ubuntu, when you can't in Windows?

3

1 Answer

The reasoning behind the first statement is false. That is a restriction from the DOS era, well before PHP or even HTTP was born. See the Wikipedia entry:

The long filename system allows a maximum length of 255 UCS-2 characters 3 4 including spaces and non-alphanumeric characters (excluding the following characters, which have special meaning within the COMMAND.COM command interpreter or the operating system kernel: \ / : * ? " < > |).

Thus it is more of a DOS restriction than a Linux/Unix permissiveness.

4

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like