[comp.binaries.ibm.pc.d] changing switch char

thf@wind.bellcore.com (Theodore Feyler) (11/18/88)

Hi,

I have just read through all the articles discussing the problems associated
with trying to change the switch character in DOS.  The end result being
that of making DOS look like UN*X.  What we want is to be able to use a slash
as a directory path delimeter and a minus sign as an argument specifier.

As everyone else has mentioned, nothing seems to work completely.  The various
switchar programs will successfully change the switch character, but alas some
software packages don't take the time and effort to see what the switch char
is (MS C 5.1 system call is the one that burns me the most). The PICNIX
package has an environment variable (PICNIX_SWITCHAR) which will make the 
various PICNIX programs work in the UN*X syntax.  However, you can't cd
properly and you can't specify a full path for a command.

Then I found out about UNCLE and the way it changes '/' to '\' and vice versa.
Well this is, unfortunately, not the answer for me.  The way my system is
configured, I need a program which will change '\' to '/', BUT NOT VICE VERSA.
(This is because of the PICNIX programs).  Since the source for UNCLE is not
available (at least not as far as i know), and I don't know how to write
TSR programs, I am at a loss.

If someone could send me the source for any TSR program written in MS C 5.1
I sure would appreciate it.  Once I write this d*mned thing I'll post it
if there is any interest at all.

---ted

P.S. If anyone knows how to get source for UNCLE, let me know please.

davis@mercury.ee.rochester.edu (Al Davis) (11/18/88)

Here is a replacement system function for msc, that supports switchar.
If only they would read their own documentation.
(instead of IBM's??)

Note: if you look in THEIR docs, switchar is documented.


int system(string)
const char *string;
{
char *shell;
char args[200];
int errcod;

if ( !(shell=getenv("COMSPEC")) )
    return 127;

sprintf(args,"%cc %s",getswitchar(),string);

errcod = spawnle(P_WAIT, shell, shell, args, NULL, environ);
_fpreset();
if (errcod == EOF)
    return 127;
return 0;
}
/*--------------------------------------------------------------------------*/
char getswitchar()
{
union REGS r;

r.h.al = 0;
r.h.ah = 0x37;
intdos(&r, &r);
return r.h.dl;
}