Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!sun-barr!newstop!sun!pepper!cmcmanis From: cmcmanis%pepper@Sun.COM (Chuck McManis) Newsgroups: comp.sys.amiga.tech Subject: Re: File name of current task Message-ID: <125228@sun.Eng.Sun.COM> Date: 25 Sep 89 18:33:24 GMT References: <2045@leah.Albany.Edu> <623@tardis.Tymnet.COM> Sender: news@sun.Eng.Sun.COM Reply-To: cmcmanis@sun.UUCP (Chuck McManis) Organization: Sun Microsystems, Mountain View Lines: 19 In article <623@tardis.Tymnet.COM> jms@tardis.Tymnet.COM (Joe Smith) writes: >AmigaDOS needs this, for the same reasons. Not as a kludge by mangling >argv[0], but as a fully supported and official way. An example function >name would be GetTaskFileName(). Of course, it should return NULL if the >task was created on the fly and not loaded straight from disk. Suggested Implementation : Have LoadSeg() store a lock in the process structure for the executable it has loaded (this will also help later if you ever want to be able to page out of the executable) and provide a routine GetProcessFileLock(Proc) or some such name that would return you this lock. The user code would have to do an Examine(lock) to find the name of the file, or it could just do a DupLock(lock);Parent(lock) to find a lock on the directory where the original executable resides. --Chuck McManis uucp: {anywhere}!sun!cmcmanis BIX: cmcmanis ARPAnet: cmcmanis@sun.com These opinions are my own and no one elses, but you knew that didn't you. "If I were driving a Macintosh, I'd have to stop before I could turn the wheel."