November 16, 2005
On Thu, 17 Nov 2005 08:29:20 +1100, Derek Parnell wrote:

> On Wed, 16 Nov 2005 11:48:40 -0800, Sean Kelly wrote:
> 
>> Walter Bright wrote:
>>> 
>>> Using '/' as a path separator in windows works sometimes, and does not work sometimes. It should be avoided.
>> 
>> Does anyone know why DOS used a '\' as a path separator to begin with? UNIX and C had been around for ages already--using the C escape signifier for a path separator instead of the established UNIX '/' convention just seems kind of silly.
>> 
> 
> DOS was based on an earlier operating system (CP/M) and that made the decision for Gates. As to why *that* used a "/" is an exercise for the reader.

What was I thinking (this was before breakfast)! The CP/M operating system and MS-DOS 1.x didn't even support directories so there was no path separator in those incarnations. The directory concept was borrowed from Unix in MS-DOS 2.0 and "Microsoft decided to use backslashes as pathname separators rather than slashes as on Unix apparently due to the latter character being used as the switch character in most DOS and CP/M programs." - to quote Wikipedia ( http://en.wikipedia.org/wiki/MS-DOS )

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
17/11/2005 9:10:53 AM
November 17, 2005
"Walter Bright" <newshound@digitalmars.com> wrote in message news:dlfuvv$20uq$1@digitaldaemon.com...
> Using '/' as a path separator in windows works sometimes, and does not
> work
> sometimes. It should be avoided.

Okay, I suppose that's good advice, _but_, there's still the issue of the std.path functions.  Although / isn't commonly used, it's still possible, and the functions should be able to handle it.  std.path even defines an altsep character in Windows, but the functions make no use of it.


November 17, 2005
On Wed, 16 Nov 2005 19:54:48 -0500, Jarrett Billingsley wrote:

> "Walter Bright" <newshound@digitalmars.com> wrote in message news:dlfuvv$20uq$1@digitaldaemon.com...
>> Using '/' as a path separator in windows works sometimes, and does not
>> work
>> sometimes. It should be avoided.
> 
> Okay, I suppose that's good advice, _but_, there's still the issue of the std.path functions.  Although / isn't commonly used, it's still possible, and the functions should be able to handle it.  std.path even defines an altsep character in Windows, but the functions make no use of it.

For what its worth, the next release of Build caters for "/" as path separators in Windows environments. The 'switch' leading character for Build is the "-" rather than the MS-DOS standard "/". Of course, it doesn't allow "\" as a path separator in Unix environments as that is a valid file name character!

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
17/11/2005 2:33:01 PM
November 17, 2005
"Sean Kelly" <sean@f4.ca> wrote in message news:dlg2ep$23lb$1@digitaldaemon.com...
> Does anyone know why DOS used a '\' as a path separator to begin with? UNIX and C had been around for ages already--using the C escape signifier for a path separator instead of the established UNIX '/' convention just seems kind of silly.

DOS 1.x did not have the concept of subdirectories (that appeared first in DOS 2.0). The '/' was commonly used to signify a switch (and still is). Therefore, a different character needed to be used to separate paths.

It's as simple as that <g>.

DOS is based on CP/M, which is based on DEC's RT-11. A lot of DOS conventions stem from RT-11. DEC's operating systems were dominant in the 1970's, so this was quite a reasonable set of conventions to follow. The dominance of unix didn't come until much later, after DEC's fall from grace.


November 17, 2005
Walter Bright wrote:
>
> DOS is based on CP/M, which is based on DEC's RT-11. A lot of DOS
> conventions stem from RT-11. DEC's operating systems were dominant in the
> 1970's, so this was quite a reasonable set of conventions to follow. The
> dominance of unix didn't come until much later, after DEC's fall from grace.

Bit before my time I guess.  I wasn't exposed to DEC systems until I got to college, and I don't think I used them for more than a bit of fiddling and the occasional game of Rogue.  My first experience with a PC was probably the 4k PETs my school managed to acquire, though I recall taking a BASIC programming course on the TRS-80 around the same time.  Hrm... now that I look at it, it appears the PET ran some version of CP/M so I guess I have used the OS before.  At the time, though, I was having too much fun with that text adventure game (Adventure?) to pay much attention to the command shell :-)


Sean
November 17, 2005
"Sean Kelly" <sean@f4.ca> wrote ...
> Walter Bright wrote:
> >
>> DOS is based on CP/M, which is based on DEC's RT-11. A lot of DOS conventions stem from RT-11. DEC's operating systems were dominant in the 1970's, so this was quite a reasonable set of conventions to follow. The dominance of unix didn't come until much later, after DEC's fall from grace.
>
> Bit before my time I guess.  I wasn't exposed to DEC systems until I got to college, and I don't think I used them for more than a bit of fiddling and the occasional game of Rogue.  My first experience with a PC was probably the 4k PETs my school managed to acquire, though I recall taking a BASIC programming course on the TRS-80 around the same time.  Hrm... now that I look at it, it appears the PET ran some version of CP/M so I guess I have used the OS before.  At the time, though, I was having too much fun with that text adventure game (Adventure?) to pay much attention to the command shell :-)

command>open door
"You are in a room filled with trolls, with a shaft of light to the west
..."
command>wield sword
"You have only a banana"
command>


November 17, 2005
Walter Bright wrote:
> "Sean Kelly" <sean@f4.ca> wrote in message
> news:dlg2ep$23lb$1@digitaldaemon.com...
> 
>>Does anyone know why DOS used a '\' as a path separator to begin with?
>>UNIX and C had been around for ages already--using the C escape
>>signifier for a path separator instead of the established UNIX '/'
>>convention just seems kind of silly.
> 
> 
> DOS 1.x did not have the concept of subdirectories (that appeared first in
> DOS 2.0). The '/' was commonly used to signify a switch (and still is).
> Therefore, a different character needed to be used to separate paths.
> 
> It's as simple as that <g>.

Actually it's not as simple as that. I remember very well that my old Amstrad PC (DR-DOS 1.2 & GEM Desktop) supported subdirectories. It even had FAT12 formatted disks. You probably mean that MS-DOS 1.x didn't support (sub)directories.

Here's a picture of that trusty old machine:

http://www.old-computers.com/museum/computer.asp?st=1&c=183

It's simply amazing that people used to have GUIs and stuff on a PC hardware 20 years ago!
November 18, 2005
In article <dlil74$1r5k$1@digitaldaemon.com>, Walter Bright says...
>
>
>
>DOS 1.x did not have the concept of subdirectories (that appeared first in DOS 2.0). The '/' was commonly used to signify a switch (and still is). Therefore, a different character needed to be used to separate paths.

True.
But since subdirectories and other features of DOS 2.0 were taken from Unix,
from the beginning the forward slash was accepted as a path separator. You could
change the default character for command line switches in config.sys (for
example '-') and get a quasi-unix environment.
Later in time (I think starting from DOS 4.0) this option was ignored by
command-line tools, so a path using forward slashes was no more recognized by
DOS shell and commands.
But at the API level forward slashes are still recognized as path separators
today.

Ciao


November 25, 2005
"Roberto Mariottini" <Roberto_member@pathlink.com> wrote in message news:dlk3j4$l8b$1@digitaldaemon.com...
> But at the API level forward slashes are still recognized as path
separators
> today.

The problem is it doesn't work consistently, and the seams show up in unexpected and unanticipated places. The most robust practice is to not try and use / as a path separator in Win32, use \.


1 2
Next ›   Last »