Tuesday, March 20, 2012

Why is the DOS path character "\"? - Larry Osterman's WebLog - Site Home - MSDN Blogs

Why is the DOS path character "\"? - Larry Osterman's WebLog - Site Home - MSDN Blogs: "Here's a little known secret about MS-DOS.  The DOS developers weren't particularly happy about this state of affairs - heck, they all used Xenix machines for email and stuff, so they were familiar with the *nix command semantics.  So they coded the OS to accept either "/" or "\" character as the path character (this continues today, btw - try typing "notepad c:/boot.ini"  on an XP machine (if you're an admin)).  And they went one step further.  They added an undocumented system call to change the switch character.  And updated the utilities to respect this flag.

And then they went and finished out the scenario:  They added a config.sys option, SWITCHAR= that would let you set the switch character to "-".

Which flipped MS-DOS into a *nix style system where command lines used "-switch", and paths were / delimited.

"

'via Blog this'