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!news1.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: How to get the application path Date: Tue, 24 Jul 2007 10:07:01 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <46a456aa$0$25908$426a34cc@news.free.fr> <1185204459.328520.240930@z24g2000prh.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1185286022 28901 192.74.137.71 (24 Jul 2007 14:07:02 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 24 Jul 2007 14:07:02 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:kUw8FIvBqFFS4UtbjpNkQ/FCXDE= Xref: g2news1.google.com comp.lang.ada:16593 Date: 2007-07-24T10:07:01-04:00 List-Id: 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. I think there ought to be a simple way for a process to find its executable file name that is guaranteed to work. Since there isn't, I guess you have to search the path (duplicating what the shell already did). These days, some folks will say, "What's a path? What's a command line?" ;-) - Bob