Live data from Hacker News

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

web.archive.org

91–100 of 166 posts

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

#91

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).

> Async-by-default I/O?

What? Can you elaborate? I mean if you want non blocking IO from an fd in Linux, you can just do that. Not sure what defaults have to do with anything. Your code will still have to be written appropriately.

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

#92
Personally I find unix or whatever OS chose / as the bad choice. / is a commonly used character, at least in the USA as dates. It would completely normal for someone to want to name a file "Meeting 12/20/1980.txt" or "Budget Sep/12/1985.doc"

Backslash has no common use I know of outside of computer related stuff like regular expressions and escaping things.

Some of you might also have forgotten but on Mac pre OS-X, at least in standard Mac devtools provided by Apple the separator was colon :

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

#93
post #73

Earlier quoted context omitted.

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.

Just don't call it "pound" when standing in Britain. :)

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

#94
post #47

In addition to its use as a path separator in DOS and Windows, the backslash character itself is also interesting because it is very likely a modern invention, with the first attestation in 1940s (!). Its original use in ASCII (1960s) was for ALGOL operator digraphs `\/` and `/\`. Its early use as the C escape sequence (1970s, replacing `*` in BCPL) suggests that it carried no significant semantics at that time.

C also has trigraphs, in case your keyboard does not have a \ you can type ??/ instead. https://en.wikibooks.org/wiki/C_Programming/C_trigraph

Mind blown. C is truly a terrifying language and I can’t help but love it for that.

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

#95
post #20

Earlier quoted context omitted.

From the third link: > (I still think the Multics path seperator looks more natural >etc>bin - too bad Unix diverted here) Looks more natural indeed. In fact it's visually similar to how paths are stylised in some file picker GUIs.

Yeah but imagine having to use Shift for every path separator you type.

Germans type Shift+7 to get /.

Imagine their horror when having to type AltGr+- to get a backslash. At least with Shift you can choose which of the Shift keys to use, but there is only one AltGr key (it is to the right of the spacebar, the US keyboard layout has the right Alt key there). It used to be you could use Ctrl+Alt+-, too, and at least those were available on the left hand side, too. But I do not know if Ctrl+Alt works nowadays.

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

#96

All wrong. "/" was the options-switch-character in CP/M, which had no sub-directories. DECs and VAXes had nothing to do this decision, because only few humans had access to such machines. I even remember I had problems adapting to directory trees in MSDOS because files were kinda hidden and lost in a floppy directory.

CP/M was surely the direct influence. Wikipedia says CP/M was itself influenced by TOPS-10, which I think also used the slash for options, so the ultimate origin may be with DEC.

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

#97
post #59
post #24

Earlier quoted context omitted.

There's always going to be ambiguity. rmdir /f /usr Is that force-deleting the /usr directory, or the /usr and /f directories?

I mean on Windows it's rd /s /q \path\to\something There's zero ambiguity because both "/" and "\" are special characters.

Except that on Windows, you can use "C:/path/to/something" nearly everywhere where it accepts "C:\path\to\something".

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

#98

All wrong. "/" was the options-switch-character in CP/M, which had no sub-directories. DECs and VAXes had nothing to do this decision, because only few humans had access to such machines. I even remember I had problems adapting to directory trees in MSDOS because files were kinda hidden and lost in a floppy directory.

It's true that DOS was originally a CP/M clone, but CP/M didn't have a defined standard option switch character, and in fact many command option switches weren't preceded by a switch indicator or differed as to what option switch character was used. If anything + and - were the most common prefixes for an option switch.

http://www.cpm.z80.de/manuals/cpm3-cmd.pdf

The article is quite right that the convention of using / for command line switches came from IBM.

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

#99
post #47

Earlier quoted context omitted.

C also has trigraphs, in case your keyboard does not have a \ you can type ??/ instead. https://en.wikibooks.org/wiki/C_Programming/C_trigraph

Mind blown. C is truly a terrifying language and I can’t help but love it for that.

It was designed in a time where keyboards around the world (German QWERTZ, Cyrillic JCKUEN/ЙЦУКЕН) and text encoding (remember that this is pre-Unicode, so we're dealing with ISO 646 and Eastern Asian character sets) has only the subset of Latin characters used in the US. Nowadays, it is strongly recommended to simply use the standard American keyboard in programming (outside of comments).

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

#100

Personally I find unix or whatever OS chose / as the bad choice. / is a commonly used character, at least in the USA as dates. It would completely normal for someone to want to name a file "Meeting 12/20/1980.txt" or "Budget Sep/12/1985.doc" Backslash has no common use I know of outside of computer related stuff like regular expressions and escaping things. Some of you might also have forgotten but on Mac pre OS-X, a…

Backslash has no non-computer use since it was invented for ASCII to represent ‘∧’ and ‘∨’ as ‘/\’ and ‘\/’.
Post reply on HN