comp.lang.ada
 help / color / mirror / Atom feed
From: "Marc A. Criley" <mcNOSPAM@mckae.com>
Subject: Re: How to get pathname of executable
Date: Tue, 13 Dec 2005 09:26:17 -0600
Date: 2005-12-13T09:26:17-06:00	[thread overview]
Message-ID: <4d4f4$439ee80e$49955ab$26123@ALLTEL.NET> (raw)
In-Reply-To: <k3Bnf.16982$_k2.286059@news2.nokia.com>

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



  reply	other threads:[~2005-12-13 15:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-13 14:40 How to get pathname of executable Dirk Heinrichs
2005-12-13 15:26 ` Marc A. Criley [this message]
2005-12-13 15:57   ` Dirk Heinrichs
2005-12-14  6:34     ` Lionel Draghi
2005-12-15  0:06       ` Randy Brukardt
2005-12-15  9:30       ` Dirk Heinrichs
2005-12-15 10:26         ` Martin Dowie
2005-12-15 13:10           ` Dirk Heinrichs
2005-12-15 17:34             ` Pascal Obry
2005-12-15 22:42             ` Simon Wright
2005-12-16  6:56               ` Martin Dowie
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox