4

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
  • 3
    Windows is NOT a standard and has never been, they have invented some very obscure things over the lifetime - that has been considered a 'de facto standard'. See this linux.com/community/blogs/133-general-linux/… for some insight. Another place to look is here - I hope you realize from these that you're in a marshland. I suggest you keep filenames pure ASCII (i.e. single byte chars, not UTF, restrict to A-Z, a-z, 0-9, and maybe some more)
    – Hannu
    Jun 29, 2014 at 10:54
  • More: Google
    – Hannu
    Jun 29, 2014 at 10:55
  • For what it is worth: "Standard" (not a 'de facto') is something that has been negotiated and agreed upon by either a national standards committee, or ISO. IETF may be seen as a 'national comittee' in this regard.
    – Hannu
    Jun 29, 2014 at 11:01

1 Answer 1

7

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
  • Wait, so if I understand you correctly, the restriction of not being able to use these characters in windows has absolutely no purpose? At all?
    – foxite
    Jun 29, 2014 at 11:04
  • 1
    @latias1290 It does: Backward Compatibility. And never underestimate the power of Backward Compatibility.
    – muru
    Jun 29, 2014 at 11:05
  • @latias1290 the windows kernel allows for special chars AND also supports case sensetivity (it is the windows software itself that imposes these limits)
    – Rinzwind
    Jun 29, 2014 at 11:13
  • @Rinzwind indeed. The (now defunct?) Subsystem for Unix Applications was POSIX compliant and not as restrictive.
    – muru
    Jun 29, 2014 at 11:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .