Newsgroups: comp.os.msdos.programmer
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!pshuang
From: pshuang@athena.mit.edu (Ping-Shun Huang)
Subject: Re: Building a better DOS revisisted (getting close to UNIX)
In-Reply-To: sorrow@oak.circa.ufl.edu's message of 21 Jun 91 19:04:47 GMT
Message-ID: <PSHUANG.91Jun23155134@beeblebrox.mit.edu>
Sender: news@athena.mit.edu (News system)
Organization: Massachusetts Institute of Technology
References: <0094A761.C2F6D640@MAPLE.CIRCA.UFL.EDU>
Date: Sun, 23 Jun 91 19:51:40 GMT
Lines: 31

In article <0094A761.C2F6D640@MAPLE.CIRCA.UFL.EDU> sorrow@oak.circa.ufl.edu writes:

 > Finally, I need more help (yes, MORE help) on how to make my prompt use
 > forward slashes.  Someone told me to intercept the DOS INT that returns
 > the correct working directory....is this safe?

This would probably be a bad thing to do.  Not dangerous per se, but it
would almost certainly break a lot of programs.  If you were to
intercept the DOS service which returns the current working directory (I
don't know which one it is off the top of my head) and return a modified
string instead, your program may work the way you want.  COMMAND.COM
interpretation of the metacharacter "$P" in the PATH variable may work
as you would want it.  CD's default response when you don't give it a
any parameters would be consistent.  However, any code which calls the
DOS service not just to print to the screen, but to actually make use of
the path returned thereafter (e.g. programs which switch the default
directory while in operation, but are polite enough to save the
directory you were in when you started it up) will break, because when
they pass the path with forward slashes back to DOS, DOS will puke.

If you feel strongly about this, you could also intercept *ALL* DOS
services which accept path names and translate forward slashes into
backslashes, and *ALL* DOS services which return any kind of path and
perform the vice versa translation.  Then you would "always" be able to
use forward slahes... exceptions being when you use low-level
applications which do not go through DOS.  Also, many programs may try
to interpret any filenames you provide on the command line as a switch.

--
Above text where applicable is (c) Copyleft 1991, all rights deserved by:
UNIX:/etc/ping instantiated (Ping Huang) [INTERNET: pshuang@athena.mit.edu]
