Live data from Hacker News

Why is the DOS path character "\"? (2005)

web.archive.org

71–80 of 166 posts

Re: Why is the DOS path character "\"? (2005)

#71

Earlier quoted context omitted.

What special about NT kernel that's not in linux kernel ?

Proper support for paged kernel memory? Async-by-default I/O? Must better power management (compare win vs linux battery life on same hardware).

The latter is definitely because the hardware manufacturers QA with it.

Re: Why is the DOS path character "\"? (2005)

#72
post #23

Can anyone explain why was that a problem, from technical point of view? They already had paths starting with "driveletter:", not like unix with just "/". Why would it be a problem for parser to distinguish between filepaths and arguments switch?

Because paths don't have to start with a drive letter – a path like \foo\bar is relative to the current drive. "DIR \W" does a DIR of the "\W" directory on the current drive. "DIR /W" does a DIR listing in wide format.

Even worse, there was (and still is) no requirement for a command and its switches to be separated with whitespace.

"DIR/W" is the same as "DIR /W".

Which would have made it impossible to determine whether you want to invoke the command "DIR" in the current directory, or the command "W" in a subdirectory named "DIR".

Re: Why is the DOS path character "\"? (2005)

#73

Do you correct people when they say “back slash” when reading out a url? When it’s actually a forward slash? Is there a name for this phenomenon? Everyone knows it’s a slash except when its used for something computery. Then it somehow becomes a backslash.

I don't have an answer but it's exactly the same phenomenon as when people refer to '#' as a hash-tag.

Re: Why is the DOS path character "\"? (2005)

#74
It was an unfortunate choice because \ is one of the 12 characters that vary between country versions of ISO 646 (of which ASCII was the US profile). This was why Japanese MS-DOS used ¥ instead of \ for the directory separator: it occupied the same code point in the Japanese profile of ISO 646 that \ did in ASCII, and Shift-JIS encoded that as a single byte with the high bit clear.

The complete list of the 12 was: # $ @ [ ] \ ^ ` { } | ~. Notice that / is safe.

They avoided the problem for all the Western languages by inventing their own 8-bit code (this was before the ISO 8859 standards) and always using ASCII in the lower half.

Re: Why is the DOS path character "\"? (2005)

#75

Do you correct people when they say “back slash” when reading out a url? When it’s actually a forward slash? Is there a name for this phenomenon? Everyone knows it’s a slash except when its used for something computery. Then it somehow becomes a backslash.

I have to suppress the urge to correct people both when they refer to it as a backslash and when they use the term "forward slash". I've already lost all my friends by being that guy; I don't need to also earn the enmity of random strangers on the internet.

But technically it's a solidus not a slash.

Re: Why is the DOS path character "\"? (2005)

#77
post #72

Earlier quoted context omitted.

Because paths don't have to start with a drive letter – a path like \foo\bar is relative to the current drive. "DIR \W" does a DIR of the "\W" directory on the current drive. "DIR /W" does a DIR listing in wide format.

Even worse, there was (and still is) no requirement for a command and its switches to be separated with whitespace. "DIR/W" is the same as "DIR /W". Which would have made it impossible to determine whether you want to invoke the command "DIR" in the current directory, or the command "W" in a subdirectory named "DIR".

The DEC operating systems (eg. RSX with its MCR shell and VMS with its DCL shell) also handled command-line switches this way (eg. PIP/LIST to list files in a directory).

Of course, they didn't use unixy paths for directories. A fully-qualified file name would be something like (and it's been decades so if I get it wrong forgive me) DRA0:[SYS.USERS.BREGMA.PROJECT.SOURCES]HELLO.C;1 and anyone who was sane would use logical names in DCL to make things readable.

Re: Why is the DOS path character "\"? (2005)

#78
post #70

Earlier quoted context omitted.

>in Linux you have ‘root’ and everything else Well, you do have: - capabilities (which are so coarse-grained as to be practically useless) - 8 types of namespaces - seccomp-bpf - LSM (AppArmor, SELinux, TOMOYO, etc)

The big difference is when you're in a multi-computer (Active Directory / NIS / LDAP) environment. On UNIX all the IDs are smallish integers, so you have to be careful to ensure they're unique and non-overlapping. On Windows you have a "SID" which is variable length and (for users) usually a big random number. https://docs.microsoft.com/en-us/troubleshoot/windows-server... Windows also differentiates between the huma…

Linux User IDs since decades are 32 bit integers; you can just use some mapping system to allocate them automatically and you’ll never run out.

The limitation is that there is one user ID, 0 which can do everything and all the other IDs can do almost nothing.

This has nothing to do with domains and everything with the distinction you describe between the Windows Administrator, local system or even more powerful trustedinstaller accounts.

Re: Why is the DOS path character "\"? (2005)

#79
post #73

Do you correct people when they say “back slash” when reading out a url? When it’s actually a forward slash? Is there a name for this phenomenon? Everyone knows it’s a slash except when its used for something computery. Then it somehow becomes a backslash.

I don't have an answer but it's exactly the same phenomenon as when people refer to '#' as a hash-tag.

Exactly. Everyone knows it's an octothorp.
Post reply on HN