Re: [Caprice32-devel] Re: Linux binary package
An emulator of the Amstrad CPC 8bit home computer range
Status: Alpha
Brought to you by:
udoewich
|
From: <nu...@gm...> - 2004-06-21 06:28:56
|
On Mon, Jun 21, 2004 at 12:26:19AM +0200, Stephane Marchesin wrote:
> Ok, I'm not sure we're talking about the same thing.
> The path you use is the current path that the shell uses, which doesn't
> take into account the path typed. For example if I do :
>
> [/home/steph/]$ ./caprice32/cap32
> The path is "/home/steph" and the config files aren't found.
> I'll have to dig, but there's a function that does this IIRC (i.e. find
> the path to the current binary).
How about an algorithm like this:
1. Look for a config file in the current dir
2. Look for a config file in the homedir of the user
3. Look for a config file in /etc
This ways you can have 1. special configurations, 2. user wide
configurations, 3. system wide configurations.
A user who installs Caprice32 via RPM automatically gets a default
configuration in /etc. He can copy it to his homedir and make individual
changes if he wants.
If the configuration file is also written to by Caprice32 things get
more complicated. I want to do this is a future version of Arnold, so
the preferences set via the GUI will be persistent. I intend doing it by
just writing the config file to the users homedir as .arnoldrc. If this
file does not exist it will be created on first invocation of Arnold.
You could also choose to go this road for Caprice32. Of course this is
entirely platform dependent. The Windows version for example could
store the same settings in the registry. But then you don't have a user
editable config file and need to provide GUI controls for each and every
option.
Btw.: I think storing the config file of Caprice32 in the same location
as the binary is not a decent idea IMHO if the binary is installed to
something like /usr/bin or /usr/local/bin. Config files should never
live inside these directorys, but only in /etc or the users homedir. Of
couse things are different if Caprice32 lives in its own directory
hierachy like /usr/local/caprice32. Games like ut2004 install that way
and can therefore have the same directory structure on Windows and on
Linux. To make invocation on the command line easier, the installer puts
a symbolic link to the main executable into /usr/local/bin. Of course
ut2004 comes which hunderds of files which are needed to run the game.
Doing this for just a config file and maybe a bunch of ROMs might be
overkill.
bye...
Andreas Micklei
P.s. Sorry for making long comments without actually contributing code.
I am just trying to help. If I get on your nerves just say so and I will
try to stop it. ;-)
|