![]() |
|
[A5] Getting directory exe is running in |
Neil Roy
Member #2,229
April 2002
![]() |
I just wanted to store the path that the executable is running in. When I try and check for a file, it shows it as not being there even though it is in the same folder as the executable, so I am uncertain where it is looking. When I used some code I found in some of the other posts in these forums, all I got was "\" which is definitely wrong. Now, I can look at argv[0] and that gives me the full path, but it includes the exe filename, also, I doubt this is very cross platform friendly (although I am mainly working with Windows at the moment). Is there an Allegro 5 function to provide this, or should I parse argv[0] myself? Thanks. --- |
Thomas Fjellstrom
Member #476
June 2000
![]() |
take a look at al_get_standard_path. -- |
Arthur Kalliokoski
Second in Command
February 2005
![]() |
ALLEGRO_PATH *path; path = al_get_standard_path(ALLEGRO_RESOURCES_PATH); al_change_directory(al_path_cstr(path,ALLEGRO_NATIVE_PATH_SEP));
They all watch too much MSNBC... they get ideas. |
jmasterx
Member #11,410
October 2009
|
Closest I see is https://www.allegro.cc/manual/5/al_get_current_directory nvm, above is better. Agui GUI API -> https://github.com/jmasterx/Agui |
Neil Roy
Member #2,229
April 2002
![]() |
Arthur Kalliokoski said:
ALLEGRO_PATH *path; Thanks. That worked. Edit: I'll create a new thread for my next problem. --- |
|