Re: silly problems with program directory



Yiannis wrote:

On 08/06/06, David NeÃas (Yeti) <yeti physics muni cz> wrote:


On Thu, Jun 08, 2006 at 04:47:13PM +0100, Yiannis wrote:
> I am having a slight problem with the program directory. What I mean is
that
> when I run a program from the directory that all the files are lying it
is
> fine.... but if I create a symbolic link and I run it from another
directory
> then the program directory is the current one of the symbolic link which > means that none of my configuration and glade xml files are found.... Is
> there any easy solution to that?

The solution is NOT to make your program dependent on the
directory it was run from and use compiled-in paths [+ env
variables] [+ command line options] to specify the location
-- which I believe is the norm.



Thanks, for that it seems that common sense is the normal in this case as
that's what I ve done so far in my programs, ie use some kind of command
line argument specifying the program directory. However, my "fears" are true as 1) A simple user wont have a clue of what a command line argument is 2) A
simple user would prefer a double-click execute-program behaviour which
leaves me with the option the way I see it of writing some kind of
install-file (*swear*):). I wonder how evinve is setup for example as you
can create a link anywhere and it will run just fine....

Install you data files in a well known location, if you are using glade files;
install them in /usr/share/my_app/data or something similar, and get
autofoo to tell you the path in your config.h... so if the user installs
into an optional prefix; it will be compiled in (i.e. /usr/local/share/my_app...).

I dont think its right to provide command line interface for this sort
of thing; its none of the user's bussiness where the app keeps its
private data files.

Nobody likes to set the $MOZILLA_FIVE_HOME to prevent gtkmozembed
applications from segfaulting on some sites; so dont be another gecko ;-)

Assuming that the users/sysadmins dont start moving your apps distributed
files around the system; it should all work out fine using the traditional
autofoo methods.

Cheers,
                               -Tristan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]