On 12 Oct 2007, at 19:27, Chris wrote:

> This may not be an FLTK specific question.  What I want to do on  
> Windows is get the path to the executable so that I can save data  
> files to a directory like APPPATH/DATA/ and also save a preference  
> file to the APPPATH directory.  It looks like that default path  
> when saving files is whichever directory I have currently opened in  
> Windows Explorer.
>
> I would also like this code to work with Linux someday.  If I  
> remember correctly, in Linux you would want to save data into the  
> users home directory, regardless of where the binary is installed.
>
> Anybody have any advice and/or example functions/code to look at?

This was discussed on the list quite recently, erm... here:

http://www.fltk.org/newsgroups.php?gfltk.general+v:22083

That code shows how an exe can find out where it "lives", on multiple  
platforms - originally with a view to having a "resources" folder in  
the apps dir.

For unix systems, you are better just having your app check for a  
HOME environment variable at runtime and using that, however, unless  
you want specifically to store stuff in the apps own folders...





_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to