I was trying to figure out how to load a file from the path where the executable stays, the first thing came to my mind is using Win32’s GetCommandLine, and then do GetFullPathName. It seems ideal in C/C++ world but obviously things don’t work quite well in Ada, especially delimiter changed from / to and then changed back, I have no idea what does Ada’s run-time library is doing.
Then I found Ada has this package – Ada.Directories, it is actually what I want. Using GetCommandLine to get the executable’s full path name, and use Ada.Directories.Containing_Directory to get the directory, all set.
This got me recall similar things in C/UNIX, though UNIX API can do whatever I want, it is usually convenience to use C functions as it fit the language well. Things are getting worse with Ada on Windows, since we all know Windows was not developed by Ada …
BTW, Ada’s identifier is really long, and actually this is the style I’m trying to follow.