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=0.7 required=5.0 tests=BAYES_00,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f954bcd9ffa6c26c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-18 07:22:11 PST Path: supernews.google.com!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Robert Dewar Newsgroups: comp.lang.ada Subject: Re: Gnat 3.13p: Command_Name RM A.15 Date: Thu, 18 Jan 2001 15:12:22 GMT Organization: Deja.com Message-ID: <94714f$7mp$1@nnrp1.deja.com> References: NNTP-Posting-Host: 205.232.38.14 X-Article-Creation-Date: Thu Jan 18 15:12:22 2001 GMT X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; U) X-Http-Proxy: 1.0 x55.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 X-MyDeja-Info: XMYDJUIDrobert_dewar Xref: supernews.google.com comp.lang.ada:4163 Date: 2001-01-18T15:12:22+00:00 List-Id: In article , comp.lang.ada@ada.eu.org wrote: > Randy Brukardt gave me a nice solution (it may not be > applicable for all cases, but for me, it worked). > > The original question was: > > Open the file with the name given by Command_Name, call the > Name function which > by A8.2(22) must return the full name, then close the file again: This obviously does NOT work if the file is not in the current directory, which for an executable file is likely. Writing a program that only works if its executable is in the current directory is defintely very bad practice, so this "solution" cannot be recommended. There is no general way of getting the full path of the current executable if it is not availabel in arg(0), which is why this cannot be guaranteed. This is an old old problem, nothing to do with Ada or GNAT! Sent via Deja.com http://www.deja.com/