When did Windows start accepting forward slash as a path separator?
aleax at aleax.it
Fri Sep 26 10:03:50 CEST 2003
Grant Edwards wrote:
> Nope. AFAIK, it's always accepted '/'. I did C programming on DOS for
> years, and I always used '/' since it was too error working with string
> literals in C that contain '\'. Those same programs seemed to run fine
> under Windows.
>> Does anyone know when that change occurred? Was it with the introduction
>> of support for long filenames in NT and Win95?
> I'm not aware that there has ever been a "change". '/' has been OK since
> the early DOS days.
I _think_ (can't be sure...) that at a C-libraries level the switch
occurred either between DOS 1.0 and 1.1, or at the time of release of
2.0. It's hard to say, because MS didn't release a C compiler as a
product back then; however, it seems that, internally, they used C
compilers running on their Unix machines (presumably their own version
of Unix, named Xenix, which they later sold to SCO) to generate some
parts of the DOS stuff of that age. The original QDOS ("Quick and
Dirty OS") that they bought out and resold as DOS 1.0 surely had no
knowledge of forward slashes -- it was basically CP/M disassembled,
hacked and reassembled (all quite illegally of course). Just as surely,
DOS 2.0 had that knowledge (Allen had also hacked into it some Unix
idioms such as I/O redirection and pipes -- some "pipes", redirecting
to a temporary file and then back out of it!, but syntactically Unixoid --
and more generally made it an uneasy mixmash of some concepts and
practice from the CP/M world plus a little from Unix traditions); and
so did the first C compiler, self-hosted on DOS, that MS later sold to
the public (having bought it, I believe, from Lattice).
More information about the Python-list