hello everybody... I have still a question that should be easy to answer for a lot of you ... ;-P

My app is static in its way of work ( working with dll , alllegro and windows.But I m using chdir("C:\\my_app_name\\saves\\folder_of_particuliar_saves");

I didn t figure out how to know wich is the hard disk ( "C:" )and the folder (\\somewhere\\my_app_name) if I let users install it anywhere on their computer.

Could someone explain me wich syntax to use to have the resident directory of installation? And how to navigate inside of it ?

I would like for example to let users use my app from an usb-key. This app is under windows, but cant be worked from emultaor under linux because of this particuliar point.( for those who will have this suggestion: my app is communicating with hardware, a compilation under linux needs to rewrite a lot of code, so first I want it purely static)

___________________________________________Democracy in Sweden? Not since 2008-Jun-18.<someone> The lesbians next door bought me a rolex for my birthday.<someone> I think they misunderstood when I said I wanna watch...

on static definition: for me Blender ( on linux and win) is a static api: it has all the dll and drivers it needs to work. A program that need external library installed on the system is not static. But perhaps Im wrong ?

get_executable_name is good, is there any split function to navigate easely from folder up to folder down ?

my app is there : /MY_APP_FOLDER/BIN/my_app.exemy bitmap are there: MY_APP_FOLDER/IMAGES

Static to me is something that doesn't change, the opposite of dynamic.A program that comes with its own DLL's and such I'd call "stand alone" rather than static.

As for getting different directory "levels", there is no such magic function AFAIK.Shouldn't be too hard to make one though. Just some simple string management

___________________________________________Democracy in Sweden? Not since 2008-Jun-18.<someone> The lesbians next door bought me a rolex for my birthday.<someone> I think they misunderstood when I said I wanna watch...

we agree that static is the good term when you do not install libraries on the system to run your app??????????????????????????i have done some linuxing during two years and some apps were said static...

I believe they mean static as in the libraries were built into the executable itself, not requiring any external libraries. However, if they deliver a bunch of libraries (located where the executable is), its not a static build. Merely a "stand alone".

The normal way of running Linux applications is to require the user to install the libraries that are needed, sharing the libraries with a bunch of other software.This has been avoided in the most recent games(and some applications) and thus they come with their own libraries it should "just work" <tm>. No need for the gamer to hunt down a plethora of libraries he/she has never heard of.

___________________________________________Democracy in Sweden? Not since 2008-Jun-18.<someone> The lesbians next door bought me a rolex for my birthday.<someone> I think they misunderstood when I said I wanna watch...

we agree that static is the good term when you do not install libraries on the system to run your app

No. Static is the opposite of dynamic, and refers to how you use libraries. So I guess you think of applications that are statically linked, so there are no runtime dependencies to other libraries which may have to be installed as well. This would not be called 'static' however, but stand-alone or independent, or self-contained or whatever.

Edit: I also don't get why you use the term API. It's the shorthand for Application Programming Interface, and doesn't make sense the way you're using it...

ok lets stay statically linked.i didn t know it was so important...thanks for precision about api. I m in france and on forums we do not use with the same meanings english terms. There is always a kind of deformation...;D

is there any function in mingw that do a replacement in a string of a certain keyword ( replace /bin by /saves ) ?

No, there isn't*. But you can use strstr() to find the first occurance of the substring you want to replace, then copy all of the proceeding string to a buffer, then strcat() what you want to replace it with, then copy the rest of the original string to the buffer.

* Not in C anyway. I don't know about C++.

edit:

Quote:

ok lets stay statically linked.

If you're using the Allegro dll, which I assume you are, since you mentined dlls in your original post, then you are dynamically linking, not statically linking (dll == Dynamic Link Library).

Yeah, it does. But you can't do MY_APP_FOLDER/BIN/my_app.exe/../../IMAGES, you have to get the directory name twice, then append the IMAGES part. I suppose you could get away with getting the directory name without a trailing slash and then calling replace_filename.

strstr used and used with strncat.i arrived to this point but still little troubles with mingw and its way to access with "\\" .and of course "\" is a special very special caracter...so now i let this down and will try the magic ".."::)