Path: utzoo!dciem!nrcaer!scs!spl1!laidbak!att!pacbell!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!munnari!otc!m From: ians@kylie.oz (Ian Sergeant) Newsgroups: comp.unix.wizards Subject: Re: Finding where an executable was run from -- a proposal. Message-ID: <252@kylie.oz> Date: 31 May 88 01:26:50 GMT Article-I.D.: kylie.252 References: <67@uvaarpa.virginia.edu> <6800012@cpe> <4527@hoptoad.uucp> <10310@ulysses.homer.nj.att.com> Organization: K.M. Software Development, Sydney, Aust. Lines: 22 Summary: kernel mod needed, what if you can't read all your path? In article <10310@ulysses.homer.nj.att.com>, dgk@ulysses.homer.nj.att.com (David Korn[eww]) writes: > > ksh passes the full pathname of the executable as the first environment > variable and names it _. Thus, if the program is run by ksh, > genenv("_"); returns a pathname for the executable. Now if everyone > would follow this convention the problem would be solved. > > David Korn > ulysses!dgk A convention is not good enough. I know of no absolutely reliable way of finding out what the absolute pathname of an executable is when you exec it. You need to be able to read all the ".." directories to be able to reliably determine the pathname of a file in your current directory in any environment. Ian. -- Ian Sergeant ACSnet: ians@kylie.oz Internet: ians@kylie.oz.au@uunet.uu.net ==