delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/06/02/17:58:47

Date: Wed, 2 Jun 93 16:05:26 CDT
From: "Jeremy Mathers" <pynq AT midway DOT uchicago DOT edu>
To: dj AT ctron DOT com
Subject: Re: command argument 0 (go32)
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu

>When "go32 x" is used to run a program, go32 does not use the path at
>all.  Thus, whenever you see no path information, it is as if you are
>typing "./" in front of everything.  The behavior is consistent with
>many Unix shells, and programs that rely on the presense of a "/" are
>begging for portability problems.  On some Unix shells, no path
>information is passed even if the program was found via the path!

I believe that is the norm - i.e., if I type 'vi' at my shell prompt,
argv[0] is exactly that - 'vi'.

True enough, we have all become spoiled by the lush info that MSDOS
provides us.  In fact, getting the full name of the currently executing
program under Unix is both a FAQ and not all trivial (in fact, basically
impossible, in the general case)

Still, GO32 *could*, in theory, artificially construct a lookalike
argv[0], based on where it finds the executable.  In fact, a further
wish would be for GO32 to search the path, so that you could say:

	go32 myprog

and have myprog be somewhere on the path.  In this case:
	1) GO32 would be acting much like user shell.
	2) This would reduce the need for STUBbing.

Still, all of this is, of course, wish list material...

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019