[Tutor] slashes in paths

Dave Angel davea at davea.name
Sun Jul 21 03:20:27 CEST 2013


On 07/20/2013 08:24 PM, Steve Willoughby wrote:
>
> On 20-Jul-2013, at 16:37, Jim Mooney <cybervigilante at gmail.com> wrote:
>> If only Bill Gates hadn't chosen '\', which is awkward to type and
>> hard to make compatible - but I think he figured his wonderful DOS
>> would be a Unix-killer, reign supreme, and there would be no
>> compatibility problem. All I can say to that is, "thank God for
>> competition."  ;')
>
> If I recall correctly, the earliest versions of DOS (which supported directories) allowed you to configure your environment to use / as a directory separator so you could really use A:/path/to/directory for things.  That wasn't the default since, if I were to guess, they had already adopted the use of "/" to introduce command-line switches which was the existing syntax on systems like CP/M and various DEC operating systems of the same era, so it would be ambiguous as to whether "foo/bar" referred to a file "bar" in the directory "foo" or the file "foo" with a "/bar" switch applied to its usage.
>

A few more details, from my memory.  DOS 1.x had various kludges to 
emulate CP/M, including the use of / for a switch character.  When DOS 2 
was introduced, the first to explicitly support a hard disk, and the new 
fat16, subdirectories were added.  The default syntax for that was the 
backslash.  When Wang's MSDOS was introduced (2.01), a pair of calls 
were added to set and test switchar, which was supposed to be used for 
command interpreting.  The idea was to use '-' as the switch character, 
leaving / to be used to separate directories.  Unfortunately, most 
commands in COMMAND.COM ignored the new function, and very few third 
party programs paid any attention at all.

The OS paid no attention to the switch, and just treated the slash and 
backslash as interchangeable.

Wang's switch character defaulted to "-", but they had little influence 
on the DOS application world.

> Having already burned that bridge, flipping the slash the other way to \ for directory separators probably seemed like a good compromise at the time.  In hindsight, I think it would have been better to just make a clean break at some early point and just change to "/" for directories, but that's never quite as easy to see as the right move at the time.
>
> I'm just glad they didn't start out using the VMS-style directory syntax or our paths would look like $DISK:[foo.bar.baz]file.ext;2
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>


-- 
DaveA



More information about the Tutor mailing list