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,eda9cd0ad906c54b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!atl-c08.usenetserver.com!news.usenetserver.com!pc02.usenetserver.com!ALLTEL.NET-a2kHrUvQQWlmc!not-for-mail Date: Tue, 13 Dec 2005 09:26:17 -0600 From: "Marc A. Criley" User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: How to get pathname of executable References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4d4f4$439ee80e$49955ab$26123@ALLTEL.NET> X-Complaints-To: abuse@usenetserver.com Organization: UseNetServer.com X-Trace: 4d4f4439ee80ea13cf00e26123 Xref: g2news1.google.com comp.lang.ada:6863 Date: 2005-12-13T09:26:17-06:00 List-Id: Dirk Heinrichs wrote: > Hello, > > I'm trying to find out how to get the complete pathname of an ada executable > on Linux. I already tried Ada.Command_Line.Command_Name, but that only > gives the executable's name as the user typed it. I want to find out where > it is stored in the filesystem so that it can load other files from > directories relative to its own directory. If you don't mind using vendor-supplied packages, and you're using GNAT, look at GNAT.OS_Lib.Normalize_Pathname(). Using this in combination with knowing what your current directory is, and/or GNAT.OS_Lib.Locate_Exec_On_Path() (if that might be needed), you can get that path. -- Marc A. Criley -- McKae Technologies -- www.mckae.com -- DTraq - XPath In Ada - XML EZ Out