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-23 13:53:14 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!uninett.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: How to find directory where the program is? Date: Tue, 23 Apr 2002 20:53:11 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: References: NNTP-Posting-Host: kiuk0152.chembio.ntnu.no X-Trace: tyfon.itea.ntnu.no 1019595191 26919 129.241.83.78 (23 Apr 2002 20:53:11 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Tue, 23 Apr 2002 20:53:11 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:23015 Date: 2002-04-23T20:53:11+00:00 List-Id: On Tue, 23 Apr 2002 14:37:22 -0500, Randy Brukardt wrote: > If you want the location that the program is launched from, you want > Argv(0) (in C terms). Ada makes this available in > Ada.Command_Line.Command_Name. Since this is implementation-defined, it > may not include the path on all targets. It does on Windows. > > The program: > > with Ada.Text_IO, Ada.Command_Line; > procedure Temp is > begin > Ada.Text_IO.Put_Line (Ada.Command_Line.Command_Name); > end Temp; > > prints: > > E:\TESTING\NT\CONSOLE\TEMP.EXE Thanks. I see that if the program is in one of the directories in the PATH on linux then one only get: temp so it is in effect how you called it was also mention earlier, but this is ok for me as I then can simply check in which directory the program is and I have it. Thanks! Preben