Live data from Hacker News

Why is the DOS path character "\"?

blogs.msdn.com

41–50 of 68 posts

Re: Why is the DOS path character "\"?

#41

I've always felt the better question is "Why is the UNIX path character "/"? People use "/" as a date separator as in 12/25/1979 so effectively banning that character as a character in filenames seems a really poor choices. By that metric chosing "\" is a much better choice because "\" is used no where I know outside of computers. I've never encountered it anywhere outside of computers so arguable it's the perfect ch…

In addition to the other reasons listed here,

/ is easier to type than \

Re: Why is the DOS path character "\"?

#42
post #8

Earlier quoted context omitted.

If you're referring to \ it's a backslash not a forward slash.

A simple way to remember forward/backslash (which I probably read on HN) is the phrase "Backslash is by the backspace" Edit: This is for the standard US keyboard. A more general way of thinking about it, though a bit more to remember: associate "positive" with "forward", and see that '/' has a positive slope. Or just go listen to a BBC podcast, and let the sound of the broadcaster saying "bbc dot co dot uk forward-sl…

It doesn't really make sense. Given we use a left-to-right and up-to-down, \ can be seen slashing forward in writing direction, starting from the top, and / backward.

Upslash / and downslash \ would make more sense, but this is what we have. My mnemonic is that forward and back are the opposite of what makes sense.

Re: Why is the DOS path character "\"?

#43

I've always felt the better question is "Why is the UNIX path character "/"? People use "/" as a date separator as in 12/25/1979 so effectively banning that character as a character in filenames seems a really poor choices. By that metric chosing "\" is a much better choice because "\" is used no where I know outside of computers. I've never encountered it anywhere outside of computers so arguable it's the perfect ch…

Of course, Windows bans the use of both / and \ (along with : and other useful things) in filenames anyway so you still can't enter dates in that format. I guess back when they made the decision on the path separator the max path length in DOS was so short it may not have seemed relevant.

Re: Why is the DOS path character "\"?

#44
post #28
post #7

Goes deeper than just IBM. Prior to DOS there was CP/M and CP/M had many programs with an older heritage. For example, it was possible to copy from a source (such as a file) to a destination (such as another file, or an I/O port) using a program called PIP ( http://en.wikipedia.org/wiki/Peripheral_Interchange_Program ). On CP/M, for example, you could print a file with the command (PRN: is the name of the printer dev…

You could still do that with copy in MS-DOS, I have a feeling my mom still does it since she has a printer on parallel port. So if she wants to print a textfile it's just copy file.txt LPT1 she can also print multiple files or results of print to file using the /b switch (binary) ignoring EOF That also explains why you shouldn't use LPT1 as file name - it was a special name that meant first parallel port. I remember…

I'm pretty sure you could still do this up until at least Win2k+ if your mapped printer had a port associated.

Re: Why is the DOS path character "\"?

#45
post #42
post #8

Earlier quoted context omitted.

A simple way to remember forward/backslash (which I probably read on HN) is the phrase "Backslash is by the backspace" Edit: This is for the standard US keyboard. A more general way of thinking about it, though a bit more to remember: associate "positive" with "forward", and see that '/' has a positive slope. Or just go listen to a BBC podcast, and let the sound of the broadcaster saying "bbc dot co dot uk forward-sl…

It doesn't really make sense. Given we use a left-to-right and up-to-down, \ can be seen slashing forward in writing direction, starting from the top, and / backward. Upslash / and downslash \ would make more sense, but this is what we have. My mnemonic is that forward and back are the opposite of what makes sense.

There's no one right way to remember something. I'm glad you found something that works for you!

Re: Why is the DOS path character "\"?

#46

What bugs me is that they chose a character right next to "Return" on the keyboard. For some reason no PC keyboard has moved it. I've had embarrassing MS-DOS moments in the past where I was typing out something like a recursive-delete on a path. If you accidentally hit RETURN instead of a backslash then you can do things like blow away entire parent directories unintentionally. This didn't exactly improve my already-…

It's funny to think of how standardized keyboards are within the US today, and yet it wasn't so long ago that you couldn't even count on the arrow keys being in the same place (or in fact, being there at all - which is why you have hjkl on Vim to this day.

On the other hand, the computers at Bell Labs had an arrow key, which is why R (which is based on S) uses 'And on a related note, I can't imagine how people use Vim without rebinding ESC to Caps_Lock. Given that ESC used to be where TAB currently is (and the latter is too useful to be removed), I don't really see a point in keeping the obsolescent Caps_Lock, especially when it's so irritating to keep moving the hand to the furthest corner of the keyboard.

Re: Why is the DOS path character "\"?

#47

What bugs me is that they chose a character right next to "Return" on the keyboard. For some reason no PC keyboard has moved it. I've had embarrassing MS-DOS moments in the past where I was typing out something like a recursive-delete on a path. If you accidentally hit RETURN instead of a backslash then you can do things like blow away entire parent directories unintentionally. This didn't exactly improve my already-…

I have always hated how the colon is used in windows for drive letters, there have been way too many times where I would type a long path only to realize that there is a semi-colon at the beginning.

Re: Why is the DOS path character "\"?

#48

I've always felt the better question is "Why is the UNIX path character "/"? People use "/" as a date separator as in 12/25/1979 so effectively banning that character as a character in filenames seems a really poor choices. By that metric chosing "\" is a much better choice because "\" is used no where I know outside of computers. I've never encountered it anywhere outside of computers so arguable it's the perfect ch…

Other people use '.' in dates. Or '-'. Especially the latter would end up with the same problem: Why is - and -- used as a switch character if it is used in dates (and even quite common in normal text, names)? And given that the history of '\' as a path separator is that long, maybe you haven't seen in elsewhere _because_ it is now forever taken for the world's most popular OS?

Why is - and -- used as a switch character if it is used in dates (and even quite common in normal text, names)

Those uses rarely have it next to whitespace, and almost never immediately after whitespace.

If someone’s named Jean-Claude, it is not customary to refer to them as -Claude for short, and if I refer to items dated 2012-03-19 and 2012-03-20, it is not customary to call one of them -20.

But that last example shows something that Unixy switches do conflict with: negative numbers.

Re: Why is the DOS path character "\"?

#49

What bugs me is that they chose a character right next to "Return" on the keyboard. For some reason no PC keyboard has moved it. I've had embarrassing MS-DOS moments in the past where I was typing out something like a recursive-delete on a path. If you accidentally hit RETURN instead of a backslash then you can do things like blow away entire parent directories unintentionally. This didn't exactly improve my already-…

It's funny to think of how standardized keyboards are within the US today, and yet it wasn't so long ago that you couldn't even count on the arrow keys being in the same place (or in fact, being there at all - which is why you have hjkl on Vim to this day. On the other hand, the computers at Bell Labs had an arrow key, which is why R (which is based on S) uses ' And on a related note, I can't imagine how people use V…

I usually swap the left ctrl and the Caps lock keys, mostly out of habit from the first computer I used (An actual computer, with the Magnetic Tape spools and punch-card boot loader).

I have also dealt with crappy tiny keyboards that don't even have any keys beyond the standard chunk (So no function keys, 10-key, or arrows / browsing control)

Re: Why is the DOS path character "\"?

#50

What bugs me is that they chose a character right next to "Return" on the keyboard. For some reason no PC keyboard has moved it. I've had embarrassing MS-DOS moments in the past where I was typing out something like a recursive-delete on a path. If you accidentally hit RETURN instead of a backslash then you can do things like blow away entire parent directories unintentionally. This didn't exactly improve my already-…

are you saying they looked into the future and chose a character next to return on a keyboard that hadn't been designed yet?

http://www.pcguide.com/ref/kb/layout/stdXT83-c.html

Post reply on HN