Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ames!mailrus!ulowell!sky!thomas From: thomas@sky.COM (Jim Thomas) Newsgroups: comp.unix.wizards Subject: a.out pathname Keywords: a.out exec Message-ID: <297@sky.COM> Date: 2 Nov 88 20:54:05 GMT Distribution: na Organization: SKY Computers, Lowell MA Lines: 19 I want to append data to an a.out file. Then I want the executing program to read the data (which, of course, would have been ignored by the exec itself). From an executing program how do I open the a.out file that was exec'd? That's easy -- get its pathname. One way to get that pathname (i.e., the first argument to execxx, not argv[0]) is to search process, text, and in-core inode tables to get the inode number plus major and minor device numbers and then to search the directories in the corresponding file system. Too time-consuming. Is there a better way? Is the FIRST argument to execxx squirreled away somewhere? If someone would suggest how to write a program that would QUICKLY find the FULL pathname of its exec'd a.out file, regardless which directory the a.out file happened to be installed in, I'd be grateful. I'm currently using SunOS 3.5. Jim Thomas uunet!swan.ulowell.edu!sky!thomas SKY Computers Inc., Foot of John Street, Lowell, MA 01852 (508)454-6200