"Lionel Draghi" wrote in message news:439fbcd3$0$19908$626a54ce@news.free.fr... > Dirk Heinrichs a �crit : > > Marc A. Criley wrote: > > > > > >>Dirk Heinrichs wrote: > >> > >>>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 using vendor specifics is a problem, and if your compiler provides > Ada 05 extensions, you may try: > Ada.Directories.Full_Name (Ada.Command_Line.Command_Name) > > And if you're only interested in the directory: > Ada.Directories.Containing_Directory (Ada.Command_Line.Command_Name) > > (Warning, I did not check this code) And if you want the full name of the directory, you need to use both: Ada.Directories.Full_Name (Ada.Directories.Containing_Directory (Ada.Command_Line.Command_Name)) If your compiler supports this new package, it's recommended to use it rather than implemented-defined packages, simply because it will make your code more portable in the long run, and no less portable in the short run (if some other compiler doesn't support Ada.Directories, then you might have to change the code, but that other compiler is rather unlikely to support GNAT-specific packages anyway, so this is no worse and likely better). Randy.