Questions...

Taylor Richards mtrs at bellsouth.net
Sun Feb 16 11:50:22 EST 2003


I put in support to read from and write to the users home directory. 
This will write things like the ini files and anything new including
pilots to (eg.) ~/.freespace2.  It will also look there first for vp
archives and the various other files it wants.  Other than trying to
figure out how best to modify cfile for this my big problem was
osregistry-unix.cpp and it not accepting a modified path without
crashing (it will write the ini file to your current directory).  I got
around this by modifying osregistry-unix.cpp to use cfile for
reading/writing files but this introduced a slight problem (that's fixed
but that's what part of the question is).

1) I used the detect_home() function and a couple of lines that make the
user directory from loki_setupdb.  I don't know if there is a licensing
issue or not involved with that?

2) In order for osregistry-unix.cpp to use cfile the default settings
had to be moved from unixmain.cpp.  I put them in a new function,
default_registry(), in os_unix.cpp along with detect_home().  Is there a
better place for these things?

3) detect_home() is used a couple of times in cfile but isn't necessary
anywhere else (the reason for using cfile in the first place).  Should
it's return value be stored for later use or is just using the function
call itself good enough since it's not called many times?

After cfile is inited in freespace.cpp is where the default_registry()
function is called.  This is working pretty good for me but I'll try and
get another person or two to test and make sure it's not going to
destroy anything. I've got a few other things in my tree at the moment
I'm working on that I'd have to clean out before cutting this patch so
I'd like to get this worked before then.


Taylor

-- 
Taylor Richards <mtrs at bellsouth.net>




More information about the freespace2 mailing list