Re: Re: [AD] set_config_file jumping around on OS X bundles

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> I would prefer to have set_config_file do different things on
> different platforms if necessary, in such a way that user code
> only makes that one call and doesn't bother if the "brains" behind
> Allegro decided that it stores the config file here or there,
> as long as it is sensible for that platform.

I agree with this, can we make these changes for 4.2? I think that might be difficult.

> Now back to the OSX platform, any nice ideas on what to do with
> configuration files?
> 
The correct locations for storing data and system-/game-/user-specific settings, _are_ well known on all the platforms; it's just a case of us writing them down. For example, on Mac I'd make use of the API function NSSearchPathForDirectoriesInDomains to get the user's settings directory.

The current config code is not right, it is based on DOS-era (e.g single user, no file permissions) thinking where it was OK to write files in the app's directory. I suggest that it should be redesigned from scratch for 4.3.

The problem that Matthew raised is just a bug - the location shouldn't jump around like that under any circumstances. The true problem is where the settings should be going - on Unix, if your game was called /usr/local/bin/mygame, settings certainly shouldn't be going in /usr/local/bin, nor should they go in some directory underneath c:\program files\ for Windows.

I'll see if I can make a Mac patch that does something sensible when I get home. 

Also, don't forget the 'magic chdir' on OSX - when run from a bundle, Allegro will automatically set the current directory to a directory within the bundle that has the same name as the binary, if one exists. This makes it easy to port a DOS/Win game that assumes that game resources will be in the same directory as the .exe. Maybe Linux could do the same, cd to /usr/local/share/exename or something similar?

Pete


-----------------------------------------
Email sent from www.ntlworld.com
Virus-checked using McAfee(R) Software 
Visit www.ntlworld.com/security for more information





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/