Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!apple!portal!atari!apratt From: apratt@atari.UUCP (Allan Pratt) Newsgroups: comp.sys.atari.st.tech Subject: Re: Can my program find its name? Message-ID: <2843@atari.UUCP> Date: 19 Feb 91 19:43:00 GMT References: <2133022@nuthaus.UUCP> <1991Feb18.205200.8638@uwovax.uwo.ca> Organization: Atari Corp., Sunnyvale CA Lines: 22 7103_2622@uwovax.uwo.ca (Eric Smith) writes: >nut@nuthaus.UUCP (Adam G. Tilghman) writes: >> I am writing a program which needs to find out its own name - >> I know this is possible, but how is it done? The only way that >> I can think of is back-tracing into the parent program to find the >> Pexec() parameters, but this doesn't ring very kosher to me :-) >> Is there a better way? >Indeed, this is a very bad thing to do -- certainly it will fail big time >under MiNT, and probably under RTX and other systems (including, perhaps, >future versions of TOS). >There is an AES call [shel_read] ... If you were started from a shell that >supports the mwc/Atari extended argument passing conventions [...] I can't tell you how gratifying it was to see this question, and then no fewer than THREE ANSWERS (A) telling legal ways to do it and (B) discouraging use of any other ways. I'm speechless! Thank you! ============================================ Opinions expressed above do not necessarily -- Allan Pratt, Atari Corp. reflect those of Atari Corp. or anyone else. ...ames!atari!apratt