From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,814d0ec938d6e4da X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-23 12:15:33 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.vmunix.org!newsfeed01.sul.t-online.de!t-online.de!newsfeed.phoenix-ag.de!news.uni-stuttgart.de!cert.uni-stuttgart.de!news.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Re: How to find directory where the program is? Date: Tue, 23 Apr 2002 21:10:13 +0200 Organization: Enyo -- not your organization Message-ID: <87662itene.fsf@deneb.enyo.de> References: NNTP-Posting-Host: deneb.enyo.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: cygnus.enyo.de 1019589018 25421 212.9.189.171 (23 Apr 2002 19:10:18 GMT) X-Complaints-To: abuse@enyo.de NNTP-Posting-Date: 23 Apr 2002 19:10:18 GMT Cancel-Lock: sha1:MyANMpJxIndCtti6HKpR0kkGA4M= Xref: archiver1.google.com comp.lang.ada:23004 Date: 2002-04-23T19:10:18+00:00 List-Id: Preben Randhol writes: > How can one in Ada95 find out from which directory the Ada program is > stored in. The solution of the general problem is not possible in Ada 95. With a few limitations and ignorierung some corner cases, you can use POSIX.5 to query the first execve() argument (the program name) and search the PATH environment variable if it is not an absolute path.