Reply to post: / vs. \

Microsoft liberates ancient MS-DOS source from the museum and sticks it in GitHub

stephanh

/ vs. \

This is fairly well documented. MS-DOS 2.0 added a bunch of Unix-like features, most importantly directories. However / was already in use to start command-line options. Which was, by the way, compatible with CP/M and various IBM OSes, so it is not as if Microsoft invented use of / for options.

So ultimately it was decided to use \ rather than Unix / as a directory separator. HOWEVER DOS and Windows have always supported / as an alternative directory separator in the API, so usually / works equally well in a context where a command-line option cannot appear (i.e. open file dialog).

(For the true pedantic: using / instead of \ will NOT work with the \\?\ path prefix.)

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon