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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,814d0ec938d6e4da X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-25 16:06:35 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!micro-heart-of-gold.mit.edu!out.nntp.be!propagator2-SanJose!propagator-SanJose!in.nntp.be!news-in-sanjose!newsfeed.onecall.net!chcgil2-snf1.gtei.net!news.gtei.net!news.binc.net!kilgallen From: Kilgallen@SpamCop.net (Larry Kilgallen) Newsgroups: comp.lang.ada Subject: Re: How to find directory where the program is? Date: 25 Apr 2002 17:57:23 -0500 Organization: LJK Software Message-ID: References: <3CC7DBFF.AE672D4D@canal-plus.fr> NNTP-Posting-Host: eisner.encompasserve.org X-Trace: grandcanyon.binc.net 1019775446 20530 192.135.80.34 (25 Apr 2002 22:57:26 GMT) X-Complaints-To: abuse@binc.net NNTP-Posting-Date: Thu, 25 Apr 2002 22:57:26 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:23123 Date: 2002-04-25T17:57:23-05:00 List-Id: In article , Philippe Waroquiers writes: > If you are using GNAT, in GNAT.OS_Lib, you find: > function Locate_Exec_On_Path > (Exec_Name : String) > return String_Access; > -- Try to locate an executable whose name is given by Exec_Name in the > -- directories listed in the environment Path. If the Exec_Name doesn't > -- have the executable suffix, it will be appended before the search. > -- Otherwise works like Locate_Regular_File below. > -- > -- Note that this function allocates some memory for the returned value. > -- This memory needs to be deallocated after use. > > This could be used (you need to find the command name first) to find > the executable file On some of the operating systems on which GNAT runs.