Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] Spell's Data Files Location . . .

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: Mads Laursen <dossen+sgl AT daimi.au.dk>
  • To: sm-discuss AT lists.ibiblio.org
  • Subject: Re: [SM-Discuss] Spell's Data Files Location . . .
  • Date: Fri, 16 Jul 2004 11:32:42 +0200

On 16/07/04 09.10, Andrew ruskie Levstik wrote:
> On Thu, 15 Jul 2004 23:36:24 -0700
> Jason Flatt <jason AT flattfamily.com> wrote:
>
> > I'm creating a spell for a program that prints a map of Middle Earth and
> > then
> > allows you to see specific areas by name. The spell is pretty much done,
> > except for that one minorly annoying "feature": the program requires its
> > data
> > files to be in the current working directory. My problem is that I don't
> > know what to do with the data files. Should I copy them to the ~
> > directory
> > or to /usr/share, or ...? Where ever the data files are copied, the user
> > will have to change to that directory before running the program. I'm
> > thinking that the home directory would be best, because of that, but the
> > files won't be tracked, and I think that would be messy to just drop 10
> > or 12
> > files to the ~ directory.
> >
> Did you think about puting both data files and the executable into
> the /usr/share dir and then making a script to launch it from
> there....

One minor nit: I believe that /usr/share is still supposed to be
arch-independent (to allow sharing it). But the basic principle is
right: create $SPELL directory in either /usr/share or /usr/lib as
appropriate, put data files + executable in directory, and put a
script in /usr/bin:

#!/bin/sh
cd /$DIRECTORY
exec $SPELL

If you find that the program needs to run from a directory which is
user writable (to allow adding extra data files or what ever), take a
look at '/var/lib/sorcery/codex/games/strategy/openttd/openttd'. It
creates a suitable dot-directory in $HOME, with symlinks for the
system files to avoid duplication.

/dossen

Attachment: pgpZ8dAY4Vaa6.pgp
Description: PGP signature




Archive powered by MHonArc 2.6.24.

Top of Page