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: g2news2.google.com!news1.google.com!news4.google.com!out04b.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!in03.usenetserver.com!news.usenetserver.com!pc02.usenetserver.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: How to get the application path References: <46a456aa$0$25908$426a34cc@news.free.fr> <1185204459.328520.240930@z24g2000prh.googlegroups.com> From: Stephen Leake Date: Wed, 25 Jul 2007 06:05:01 -0400 Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:ihHMd796Xuo+9xu6s5PcE/H4/5g= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 88f6046a7204d759e00d412718 Xref: g2news2.google.com comp.lang.ada:1165 Date: 2007-07-25T06:05:01-04:00 List-Id: Robert A Duff writes: > 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. Hmm. It seems I missed A.16 (48): 48/2 The default directory is the directory that is used if a directory or file name is not a full name (that is, when the name does not fully identify all of the containing directories). -- -- Stephe