When did Windows start accepting forward slash as a path separator?

Tim Roberts timr at probo.com
Fri Sep 26 00:21:08 EDT 2003


Grant Edwards <grante at visi.com> wrote:
>
>Ben Finney wrote:
>
>>> But now, among a small group of cognoscenti, it is a truism that this is a
>>> myth, and that Windows will allow you to use either the forward or the
>>> backward slash as a pathname separator.
>> 
>> I highly doubt it, since the forward slash (or just "slash") is the
>> conventional Windows command-line option indicator,
>
>That was configurable back in the DOS days.  There was a "well-known" byte in
>system RAM that contained the "switch" character.  IIRC, DOS even shipped
>with a utility to change that value.

Yes, indeed.  There was a SWITCHAR option in config.sys, and a
corresponding DOS service, until DOS 3.0, when it was removed because they
couldn't make it work with network software.

So, the situation can be summed up rather simply:

  * All DOS services since DOS 2.0 and all Windows APIs accept either
forward slash or backslash.  Always have.

  * None of the standard command shells (CMD or COMMAND) will accept
forward slashes.  Even the "cd ./tmp" example given in a previous post
fails.
-- 
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.




More information about the Python-list mailing list