[comp.sys.ibm.pc] / as a dir delimiter

larsen@mist.cs.orst.edu (Scott Larsen) (03/07/90)

Does anyone know if you can change the default directory delimiter from
a back slash to a forward slash?  I am a unix user and find MS-DOS's
use of a backslash rather annoying, as well as disasterous in c programs.

Any ideas?

-Scott Larsen
larsen@cs.orst.edu                       UUCP: hplabs!hp-pcd!orstcs!larsen
--------------------------------------------------------------------------
"Open the pod bay doors, Hal."
		- David Bowman

david@metapyr.UUCP (David Relson) (03/09/90)

Early versions of DOS had a CONFIG.SYS option called SWITCHAR (switch
character).  Normally in DOS, switched are signaled by / (compared to - in
UNIX).  This option allowed setting the SWITCHAR to -.  Programs which 
used the SWITCHAR setting would then use - rather than /.  All of DOS's
file system calls (internal, INT level stuff) allow either / or \ so they
work as you would like.  So far everything seems pretty ok.

The gotcha is that very few programs ever checked SWITCHAR.  As I 
recall, some DOS utilities like LINK used it, but no other programs used 
it. 

Had Microsoft publicized SWITCHAR and used it consistently,  perhaps authors
of other programs would have used it.  This would enable what you want.

Bottom line, things WERE set up to support a user selectable delimiter, but
since nobody ever used the facility, you won't be able to do what you want.

toma@tekgvs.LABS.TEK.COM (Tom Almy) (03/09/90)

In article <16559@orstcs.CS.ORST.EDU> larsen@mist.CS.ORST.EDU (Scott Larsen) writes:
>Does anyone know if you can change the default directory delimiter from
>a back slash to a forward slash?  I am a unix user and find MS-DOS's
>use of a backslash rather annoying, as well as disasterous in c programs.
>
>Any ideas?

This is actually only a problem with the command interpreter (COMMAND.COM)
as DOS file functions will accept either slash (thus, don't worry in your
C programs).

The problem is actually the "switch" character, which is "/" in DOS and
by convention "-" in UNIX. Programs including COMMAND.COM assume that
the switch character indicates a switch rather than a file, disallowing
use of the forward slash unless the switch character is changed.

Why these strange non-UNIX conventions? Because MS-DOS is following a
lineage *OLDER* than UNIX. The use of "/" as the switch character is a
holdover from CP/M, which adopted it from DEC proprietary operating systems.
(Aside: be glad you don't use the 'PIP' command to copy files!)
When DOS 2.0 came around and it was necessary to have a hierarchical, UNIX-like
file system they had to pick another character. At least someone at MS had
the sense to allow DOS to accept either slash.

In DOS 2.x you could put a statement in CONFIG.SYS to set the switch character.
   An undocumented system call could be used to fetch/set the switch character.
In DOS 3.x you had to use the system call.
In DOS 4.x the system call has been disabled.

Also, a seemingly increasing percentage of programs will not work when the
switch character has been changed.

I hope you see the handwriting on the wall.

Perhaps the best bet is to change the filename separator character in UNIX
to match DOS, rather than changing DOS to match UNIX.  Or maybe just accept
that these are two different operating systems.

Tom Almy
toma@tekgvs.labs.tek.com
Standard Disclaimers Apply

zraisin@gritty.UUCP (Emile Deen) (03/09/90)

In article <16559@orstcs.CS.ORST.EDU>, larsen@mist.cs.orst.edu (Scott Larsen) writes:
> Does anyone know if you can change the default directory delimiter from
> a back slash to a forward slash?  I am a unix user and find MS-DOS's
> use of a backslash rather annoying, as well as disasterous in c programs.

	Same here, someone post the answer if it exists......



> -Scott Larsen
> larsen@cs.orst.edu                       UUCP: hplabs!hp-pcd!orstcs!larsen
> --------------------------------------------------------------------------
> "Open the pod bay doors, Hal."
> 		- David Bowman

				Tanx in Advanz....

				-Z Raisin

-- 
-------------------------------------------------------------------------------
rutgers!gritty!zraisin |_ _S_u_p_e_r_ _A_m_a_z_i_n_ _ _C_i_n_n_a_m_o_n_ _R_a_i_s_i_n_ | deen@topaz.rutgers.edu
-------------------------------------------------------------------------------
_<___ _<_ _<_ _<_ _M_ _A_ _Y_ _ _ _T_ _H_ _E_ _ _ _ _P_ _R_ _E_ _Z_ _E_ _N_ _T_ _ _ _T_ _E_ _N_ _Z_ _ _B_ _E_ _ _ _W_ _I_ _T_ _H_ _ _ _Y_ _O_ _U_ _>_ _>_ _>_ _>
------------------------------------------------------------------------------- 

elund@pro-graphics.cts.com (Eric Lund) (03/11/90)

In-Reply-To: message from larsen@mist.cs.orst.edu
> Does anyone know if you can change the default directory delimiter from
> a back slash to a forward slash?  I am a unix user and find MS-DOS's
> use of a backslash rather annoying, as well as disasterous in c programs.


ARGH!  Not another UNIX convert!  You're absolutely right, MS-DOS stinks ...
now go back to UNIX.  We already know the limits of DOS!  Anyhow, I am aware
of the problems the "double" backslash caused by MS-DOS C source ... yes it's
a pain.  My solution:  Get used to it.  This is not UNIX, and the only way to
do many things is incredibly hard, incompatible and disastrous.  You'd
probably have to go change COMMAND.COM itself ... DO NOT DO IT!  Please just
get used to this crappy operating system or go back to unix.  It's not good to
give ideas to MS-DOS users.  

I hear it now, "But he says in unix he can ..."

Eric
                                                  
Eric W. Lund *DISCLAIMER "Disclaimers are for weak people."* Prodigy: xcbr22b
UUCP: ...crash!pro-graphics!elund *COWS FOR RENT* ProLine: elund@pro-graphics
Internet: elund@pro-graphics.cts.com ** ARPA/DDN: pro-graphics!elund@nosc.mil
 

larsen@mist.cs.orst.edu (Scott Larsen) (03/11/90)

In message <1794@crash.cts.com>, Eric W. Lund <elund@pro-graphics.cts.com>
writes:

> ARGH!  Not another UNIX convert!  You're absolutely right, MS-DOS stinks ...
> now go back to UNIX.  We already know the limits of DOS!  Anyhow, I am aware
> of the problems the "double" backslash caused by MS-DOS C source ... yes it's
> a pain.  My solution:  Get used to it.  This is not UNIX, and the only way to
> do many things is incredibly hard, incompatible and disastrous.  You'd
> probably have to go change COMMAND.COM itself ... DO NOT DO IT!  Please just
> get used to this crappy operating system or go back to unix.  It's not good to
> give ideas to MS-DOS users.  
> 
> I hear it now, "But he says in unix he can ..."

While although I agree that some source code may still cause a problem,
I don't ever think that giving up is a rational reaction to a problem.
And as a matter of fact, I received and unearthed many ideas, one of which,
was to try the 4DOS command interpreter, a far superior interpreter than
command.com.  Another is the fact that MS-DOS does recognize the forward
slash as a directory delimiter, but the switch character is, by default,
set to that character.  All you have to do is a 21h interrupt to change the
default switch character to, say a -, then dos will catch the "/" as a 
directory delimiter, and not a command option.

All in all, I was rather disappointed by this attitude.  Just complaining,
and not testing out possibilities ("DO NOT DO IT!") is a rather backwards
way of going about scientific research, don't you think?  No
experimentation, no attempts, no success, no failure.  I would hate to
think of what our science would be like today if Newton, Fermi, Bohr,
Mendel, Edison, and Tesla never did any experiments.  Current limits,
or problems can only show us the places that need improvement and more
study.

-Scott Larsen
larsen@cs.orst.edu                       UUCP: hplabs!hp-pcd!orstcs!larsen
--------------------------------------------------------------------------
"There is only one thing in the world worse than being talked about, and
 that is not being talked about."
		- Oscar Wilde

kaleb@mars.jpl.nasa.gov (Kaleb Keithley) (03/12/90)

In article <249@gritty.UUCP> zraisin@gritty.UUCP (Emile Deen) writes:
> Does anyone know if you can change the default directory delimiter from
> a back slash to a forward slash?  I am a unix user and find MS-DOS's
> use of a backslash rather annoying, as well as disasterous in c programs.

So use forward slashes in your C programs.  RTFM, the *only* thing that
requires back slashes is COMMAND.COM.  Everything else can use either forward
or backward slashes as directory delimiters; unless is is some brain-dead
application that checks explicitly for backslashes and disallows anything
else.  

BTW, I use both *nix and DOS, and since I came from DOS to *nix, I could
say something like "forward slashes are rather annoying", but I don't! 

kaleb@mars.jpl.nasa.gov            Jet Propeller Labs
Kaleb Keithley

spelling and grammar flames > /dev/null

ho@fergvax.unl.edu (Tiny Bubbles...) (03/13/90)

From article <1794@crash.cts.com>, by elund@pro-graphics.cts.com (Eric Lund):
> In-Reply-To: message from larsen@mist.cs.orst.edu
>> Does anyone know if you can change the default directory delimiter from
>> a back slash to a forward slash?  I am a unix user and find MS-DOS's
>> use of a backslash rather annoying, as well as disasterous in c programs.
> 
> 
> ARGH!  Not another UNIX convert!  You're absolutely right, MS-DOS stinks ...
> now go back to UNIX.  We already know the limits of DOS!  Anyhow, I am aware
> of the problems the "double" backslash caused by MS-DOS C source ... yes it's
> a pain.  My solution:  Get used to it.  This is not UNIX, and the only way to
> do many things is incredibly hard, incompatible and disastrous.  You'd

Snicker... there's an undocumented DOS call that will even let you use a 
slash as a delimiter from the DOS prompt.  I don't remember what it is, 
and I highly advise against using it because most programs are hard-wired
to assume that backslashes are used as delimiters.

Furthermore, when you ask DOS what directory you're in (and you're using
that option), it makes the first backslash a slash and leaves the rest:
example, it will report crap like C:/USR\BILLY\BOB ... real &#*%&( confusing.

However, a tip:  I always use the slash in C programs.  MS-DOS seems to 
accept the slash at the below-COMMAND level.  Or, maybe that's Turbo C 
shielding me from a slightly stubborn OS... I don't know.  Try it.
---
        ... Michael Ho, University of Nebraska
Internet: ho@hoss.unl.edu               USnail:  115 Nebraska Union
                                                 Lincoln, NE 68588-0461

elund@pro-graphics.cts.com (Eric Lund) (03/13/90)

In-Reply-To: message from larsen@mist.cs.orst.edu
> All in all, I was rather disappointed by this attitude.  Just complaining,
> and not testing out possibilities ("DO NOT DO IT!") is a rather backwards
> way of going about scientific research, don't you think?  No
> experimentation, no attempts, no success, no failure.  I would hate to
> think of what our science would be like today if Newton, Fermi, Bohr,
> Mendel, Edison, and Tesla never did any experiments.  Current limits,
> or problems can only show us the places that need improvement and more
> study.

After reviewing my message, I have concluded I was not as hopelessly backwards
as you think.  I objected to the tinkering of command.com, because it is an
extremely dangerous thing to do.  Having used unix, I have given though to the
"alternate delimiter" problem, and found the situation was more taxing than it
deserved.  By far, the simplest solution was to GET USED TO IT.  It wasn't
that hard -- just a matter of taste.  I hardly think your comparison to
scientific research and great discoverers is applicable.  DO NOT DO IT was a
warning from experience.  If you tamper with certain things, they will break. 
Often, when things break, they fall on other things and break them.  (IE, your
hard disk!)  Sorry for discouraging you.  I hope scientific research can live
with the devastating blow I gave it.

And if you do "research" 4DOS, could you please post your findings.  (In the
interest of science and progress, of course.)

Thank you.
                                                  
Eric W. Lund *DISCLAIMER "Disclaimers are for weak people."* Prodigy: xcbr22b
UUCP: ...crash!pro-graphics!elund *COWS FOR RENT* ProLine: elund@pro-graphics
Internet: elund@pro-graphics.cts.com ** ARPA/DDN: pro-graphics!elund@nosc.mil
 

res@cbnewsc.ATT.COM (Rich Strebendt) (03/15/90)

In article <249@gritty.UUCP>, zraisin@gritty.UUCP (Emile Deen) writes:
> In article <16559@orstcs.CS.ORST.EDU>, larsen@mist.cs.orst.edu (Scott Larsen) writes:
> > Does anyone know if you can change the default directory delimiter from
> > a back slash to a forward slash?  I am a unix user and find MS-DOS's
> > use of a backslash rather annoying, as well as disasterous in c programs.
> 
> 	Same here, someone post the answer if it exists......

As a UNIX user for some time who is also trying to use MeSsiDOS, I can
relate to this problem.  I have found that the MKS Toolkit is worth
every penny of its cost in freeing me of the silly COMMAND.COM
limitations and giving me virtually the same command set as I use
daily on my UNIX machines.  For example, the diff command is provided
and generates the same output you get from the command of the same
name in UNIX.  In addition, there is a "switch" command
included in the Toolkit which makes the change you want -- replaces
the backslash with the slash and the slash with the dash.
Unfortunately, there are a few MSDOS commands which have the
bass-ackwards slash hardcoded for directory names, but these are
happily few in number and easily learned from experience.

					Rich Strebendt
					...!att!ihlpb!res
					r.strebendt@att.com

marshall@wind55.seri.gov (Marshall L. Buhl) (03/16/90)

Various long-time *nix users asked if there was a way to modify MS DOS so
that one could use "/" instead of "\" to delimit directories.

I can't answer that, but as a long time PC user whose started dabbling in
*nix, how can I modify *nix to use the "\" delimiter instead of "/"?  You 
know, the way God intended it to be.

8-), 8-), 8-) for the humor impaired.
--
Marshall L. Buhl, Jr.                   EMAIL: marshall@wind55.seri.gov
Senior Computer Engineer                VOICE: (303)231-1014
Wind Research Branch                    1617 Cole Blvd., Golden, CO  80401-3393
Solar Energy Research Institute         Solar - safe energy for a healthy future

andy@mks.com (Andy Toy) (03/16/90)

In article <1990Mar15.192216.4153@seri.gov> marshall@wind55.seri.gov (Marshall L. Buhl) writes:
>Various long-time *nix users asked if there was a way to modify MS DOS so
>that one could use "/" instead of "\" to delimit directories.

>I can't answer that, but as a long time PC user whose started dabbling in
>*nix, how can I modify *nix to use the "\" delimiter instead of "/"?  You 
>know, the way God intended it to be.

Write a new shell for UNIX that looks like command.com :-)
It should be easier than writing a UNIX-style shell for DOS.
-- 
Andy Toy, Mortice Kern Systems Inc.,       Internet: andy@mks.com
  35 King Street North, Waterloo,       UUCP: uunet!watmath!mks!andy
      Ontario, CANADA N2J 2W9      Phone: 519-884-2251  FAX: 519-884-8861

toma@tekgvs.LABS.TEK.COM (Tom Almy) (03/17/90)

In article <1990Mar16.141118.26192@mks.com> andy@mks.com (Andy Toy) writes:
>In article <1990Mar15.192216.4153@seri.gov> marshall@wind55.seri.gov (Marshall L. Buhl) writes:
>>Various long-time *nix users asked if there was a way to modify MS DOS so
>>that one could use "/" instead of "\" to delimit directories.
>>I can't answer that, but as a long time PC user whose started dabbling in
>>*nix, how can I modify *nix to use the "\" delimiter instead of "/"?  You 
>>know, the way God intended it to be.

>Write a new shell for UNIX that looks like command.com :-)
>It should be easier than writing a UNIX-style shell for DOS.
>Andy Toy, Mortice Kern Systems Inc.,       Internet: andy@mks.com

Smiley face or not, you are probably right! (And you should know about
writing a UNIX-style shell for DOS.)

Since in DOS, the programs themselves do command line parsing, you can
never really handle the slash confusion without patching a bunch of
executables (although, if my memory serves, ANARKEY will flip the slashes
for selected programs (you give it the list of culprits)).

On the other hand, the UNIX shell does the bulk of the command line
parsing, so writing a UNIX shell that would allow file names with back
slashes would be fairly straight forward.

It should be a great moneymaking product -- just think of all the hoards
of MSDOS users that are scared of UNIX, but would accept it if the commands
were the same!

Tom Almy
toma@tekgvs.labs.tek.com
Standard Disclaimers Apply

"copy /b flames*.* nul"

davidsen@sixhub.UUCP (Wm E. Davidsen Jr) (03/18/90)

In article <14409@cbnewsc.ATT.COM> res@cbnewsc.ATT.COM (Rich Strebendt) writes:

| As a UNIX user for some time who is also trying to use MeSsiDOS, I can
| relate to this problem.  I have found that the MKS Toolkit is worth
| every penny of its cost in freeing me of the silly COMMAND.COM
| limitations and giving me virtually the same command set as I use
| daily on my UNIX machines.  

  For those who just want a real shell for DOS, v1.5 of ms_sh, a clone
of Bourse shell, will be posted to c.b.i.p soon (maybe later today).
-- 
bill davidsen - davidsen@sixhub.uucp (uunet!crdgw1!sixhub!davidsen)
    sysop *IX BBS and Public Access UNIX
    moderator of comp.binaries.ibm.pc
"Getting old is bad, but it beats the hell out of the alternative" -anon

doerschu@rex.cs.tulane.edu (David Doerschuk) (03/26/90)

In article <1822@crash.cts.com> elund@pro-graphics.cts.com (Eric Lund) writes:
>In-Reply-To: message from larsen@mist.cs.orst.edu
>> All in all, I was rather disappointed by this attitude.  Just complaining,
>> and not testing out possibilities ("DO NOT DO IT!") is a rather backwards
>> way of going about scientific research, don't you think?  No
>
>After reviewing my message, I have concluded I was not as hopelessly backwards
>as you think.  I objected to the tinkering of command.com, because it is an

1.  4DOS will change the switchar, but its overkill unless you want it for
    some of the (many) other benefits it provides.

2.  ANARKEY is a very slick command line editor that augments, rather than
    replaces, command.com.  It will change the switch char, and also provide
    a very fine history mechanism, aliasing, and metakey-style filename
    completion.

3.  The PICNIX set of utilities has a switch char program named switchar
    that does just that and no more.  Its a great set of utilities;
    essentially designed for folks that spend a lot of time on *NIX systems
    and find it difficult to change mindsets back and forth from *NIX to DOS.
    (like me!)

Patching command.com is not particularly dangerous, but it may not work
afterwards!  :-)  Lighten up, guys.

ts@uwasa.fi (Timo Salmi LASK) (03/27/90)

In article <2609@rex.cs.tulane.edu> doerschu@rex.UUCP (David Doerschuk) writes:
>3.  The PICNIX set of utilities has a switch char program named switchar
>    that does just that and no more.  Its a great set of utilities;
>    essentially designed for folks that spend a lot of time on *NIX systems
>    and find it difficult to change mindsets back and forth from *NIX to DOS.
>    (like me!)

There is also a switchar.exe in (/pc/ts/)tsultd13.arc.  It is, as
are the picnix collections, available by anonymous ftp from
chyde.uwasa.fi.

...................................................................
Prof. Timo Salmi        (Moderating at anon. ftp site 128.214.12.3)
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun

d88-cwe@nada.kth.se (Christian Wettergren) (03/28/90)

In article <2609@rex.cs.tulane.edu> doerschu@rex.UUCP (David Doerschuk) writes:
>3.  The PICNIX set of utilities has a switch char program named switchar
>    that does just that and no more.  Its a great set of utilities;
>    essentially designed for folks that spend a lot of time on *NIX systems
>    and find it difficult to change mindsets back and forth from *NIX to DOS.
>    (like me!)

If I don't remember wrong, I think that MSDOS 3.X doesn't support the 
switchar-call anymore. Since I have not followed this discussion, this has
probably been said fifteen times (my usual luck...).

I dont know what the switchar.exe program does, but if it calls MSDOS,
it will fail for MSDOS 3.X!

Regards,
	Christian Wettergren
--------------------------------------------------------------------------
"Computer Science is not about computers, any more than astronomy is about
 telescopes" - Edgar Dijkstra
Christian Wettergren, d88-cwe@nada.kth.se, 08 - 36 96 92


-- 
--------------------------------------------------------------------------
"Computer Science is not about computers, any more than astronomy is about
 telescopes" - Edgar Dijkstra
Christian Wettergren, d88-cwe@nada.kth.se, 08 - 36 96 92