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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no 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!postnews.google.com!w3g2000hsg.googlegroups.com!not-for-mail From: qouify Newsgroups: comp.lang.ada Subject: Re: How to get the application path Date: Mon, 23 Jul 2007 05:06:30 -0700 Organization: http://groups.google.com Message-ID: <1185192390.472123.223310@w3g2000hsg.googlegroups.com> References: <46a456aa$0$25908$426a34cc@news.free.fr> NNTP-Posting-Host: 163.173.228.31 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1185192390 9462 127.0.0.1 (23 Jul 2007 12:06:30 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 23 Jul 2007 12:06:30 +0000 (UTC) In-Reply-To: <46a456aa$0$25908$426a34cc@news.free.fr> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); fr; rv:1.8.1.4) Gecko/20060911 SUSE/2.0.0.4-1.2 Firefox/2.0.0.4,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: w3g2000hsg.googlegroups.com; posting-host=163.173.228.31; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Xref: g2news1.google.com comp.lang.ada:16549 Date: 2007-07-23T05:06:30-07:00 List-Id: On 23 juil, 09:20, Rangdalf wrote: > Hi, > > In C# there is something like Application.startupPath. Is there a > package or function to get this path. > I can get the current directory but I need the application one. > > Regards Hi, the gnat provides the function Locate_Exec_On_Path. you can locate the path of an application if it is in the path environment variable by doing this with gnat.os_lib; ... A : String_Access := Locate_Exec_On_Path("gcc"); begin if A = Null then Put_Line("gcc not found in your PATH"); else ...