Article View: comp.sys.amiga.tech
Article #533Re: What is my name?
From: Doug Merritt
Date: Wed, 19 Jul 1989 15:41
Date: Wed, 19 Jul 1989 15:41
24 lines
1697 bytes
1697 bytes
><In article <26385@agate.BERKELEY.EDU> mwm@mica.berkeley.edu (Mike (I'll think of something yet) Meyer) writes:
><>Before I sit down & write it myself, does anyone have a piece of code
><>that will give me a full name for the binary it's running in? Not just
Rob Peck said:
><Listing 2.9 in the Programmer's Guide To The Amiga gives you the
In article <26406@agate.BERKELEY.EDU> mwm@eris.berkeley.edu (Mike (I'll think of something yet) Meyer) writes:
> The code in listing 2.9 prints the name of the current
>directory. This is may not be the name of the directory that the
>running file is from. Consider the following script, with "myname.c"
Well, for a workbench program that's easy...WBenchMsg->sm_ArgList[0].wa_Lock
is a lock on the file the executable came from, and the usual Examine()/
ParentDir() loop will turn that into a full path quite easily (SMOP).
I couldn't find anything comparable for CLI-launched programs, although
I wondered about (struct CommandLineInterface)->cli_CommandDir. If that
doesn't do it than I guess the only solution is the previously posted
answer of "which".
Doug
--
Doug Merritt {pyramid,apple}!xdos!doug
Member, Crusaders for a Better Tomorrow Professional Wildeyed Visionary
Technical Details
Message-ID:
<430@xdos.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!motcsd!xdos!dougReferences:
<26385@agate.BERKELEY.EDU> <7330@ardent.UUCP> <26406@agate.BERKELEY.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!motcsd!xdos!doug From: doug@xdos.UUCP (Doug Merritt) Newsgroups: comp.sys.amiga.tech Subject: Re: What is my name? Message-ID: <430@xdos.UUCP> Date: 19 Jul 89 15:41:29 GMT References: <26385@agate.BERKELEY.EDU> <7330@ardent.UUCP> <26406@agate.BERKELEY.EDU> Reply-To: doug@xdos.UUCP (Doug Merritt) Organization: Hunter Systems, Mountain View CA (Silicon Valley) Lines: 24