Hi....
Assume I have this directory: /opt/blabla
Inside it there are: bla ( executable file ) and resource.txt ( resource file needed by bla )
$ cd /opt/blabla
$ ./bla
Everything runs fine...
$ cd ~/
$ /opt/blabla/bla
Error: cann't find resource.txt
or
$ ln -s /opt/blabla/bla /usr/bin/bla
$ cd ~/
$ bla
Error: cann't find resource.txt
Is there anyway to set the current ( working ) directory to where the binary live????? I mean in bla code anyway..... So, this is part of bla source code:
Hardcode path is not an option....Code:String file = "resource.txt"; //how to set the working directory to where the binary live..... LoadTheFile( file );
Thank you....