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-Thread: 103376,b97aa4480eccc494 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!z28g2000prd.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: How to get the application path Date: Tue, 24 Jul 2007 07:58:15 -0700 Organization: http://groups.google.com Message-ID: <1185289095.950627.169110@z28g2000prd.googlegroups.com> References: <46a456aa$0$25908$426a34cc@news.free.fr> <1185204459.328520.240930@z24g2000prh.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1185289101 23541 127.0.0.1 (24 Jul 2007 14:58:21 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 24 Jul 2007 14:58:21 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: z28g2000prd.googlegroups.com; posting-host=66.126.103.122; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Xref: g2news1.google.com comp.lang.ada:16595 Date: 2007-07-24T07:58:15-07:00 List-Id: On Jul 24, 7:07 am, Robert A Duff wrote: > Stephen Leake writes: > > Adam Beneschan writes: > >> If we assume that Command_Name returns the name of some (executable) > >> file that may or may not be a full path name, then > >> Ada.Directories.Full_Name (Ada.Command_Line.Command_Name) should > >> return the full path, > > > Yes, this is the right solution. > > I don't think Full_Name is what you want. > > If you are in /home/myself, and you type foo on the command line, and it > finds /usr/bin/foo (using your path) and runs it, and Command_Name = "foo", > then calling Full_Name will give you /home/myself/foo, not > /usr/bin/foo. Yes, I forgot about that. -- Adam