[Tutor] where to put data files
Paul Tremblay
phthenry@earthlink.net
Fri Feb 14 01:07:00 2003
On Thu, Feb 13, 2003 at 08:01:43PM -0800, Sean 'Shaleh' Perry wrote:
> according to the FHS (File Hierarchy Standards) used by Linux distributions
> data that is architecture neutral and usable by multiple installations
> belongs in /usr/share/<something>/ (or in your case
> /usr/local/share/<something>).
>
> /etc is for configuration data that you expect the sysadmin to want to
> change/add/remove/whatever.
I didn't know this. This is helpful.
>
> > Also, should I use a relative path? I guess if I use a relative path,
> > then each time the script runs, it will have to check for the location
> > of the data directoy:
> >
>
> you should probably use a full path that is easy to change. So if a user
> wants to instll your program in say /opt/program/ they can.
But how do I do this? The line that will look for the character file
will be in the actual script. When the user installs the modules,
script, and data file, the installer will somewhow have to read the path
and change a line in the main script.
In other words, if the user chooses /opt/program, the script will be put
in /opt/program/bin, the modules will be put in
/opt/program/lib/python2.x/site-packages/rtf2xml/*, and the data file
will be put in /opt/program/rtf_data/rtf_char_set.
In one of the modules:
read_obj = open(path_to_char_set)
## now read each line in and form a hash
How do I insure that path will always find the actual charater file?
Thanks
Paul
--
************************
*Paul Tremblay *
*phthenry@earthlink.net*
************************