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 12:35:30 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsmi-us.news.garr.it!NewsITBone-GARR!area.cu.mi.it!newsfeeder.edisontel.com!skynet.be!skynet.be!ossa.telenet-ops.be!nmaster.kpnqwest.net!nreader2.kpnqwest.net.POSTED!not-for-mail Newsgroups: comp.lang.ada Subject: Re: How to find directory where the program is? References: <3CC7DBFF.AE672D4D@canal-plus.fr> From: Philippe Waroquiers Message-ID: Organization: Eurocontrol User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cache-Post-Path: ecw.eurocontrol.be!unknown@193.221.189.81 X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/) Date: Thu, 25 Apr 2002 19:30:54 GMT NNTP-Posting-Host: 193.221.170.178 X-Complaints-To: abuse@Belgium.EU.net X-Trace: nreader2.kpnqwest.net 1019763054 193.221.170.178 (Thu, 25 Apr 2002 21:30:54 MET DST) NNTP-Posting-Date: Thu, 25 Apr 2002 21:30:54 MET DST Xref: archiver1.google.com comp.lang.ada:23120 Date: 2002-04-25T19:30:54+00:00 List-Id: 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 -- Philippe WAROQUIERS Eurocontrol - Central Flow Management Unit philippe.waroquiers@eurocontrol.int Rue de la fusee, 96 Tel: +32 2 729 97 35 1130 Brussels Fax: +32 2 729 90 22 Belgium