[Tutor] where to put data files

Sean 'Shaleh' Perry shalehperry@attbi.com
Thu Feb 13 23:03:02 2003


On Thursday 13 February 2003 19:47, Paul Tremblay wrote:
> I have a script that needs to read from a data file, and I want to know
> the best location for the data file.
>
> Right now, I have this line in my setup.py:
>
>             data_files=3D[('data', ['char_set'])],
>
> This means that in a normal installation, the setup scipt will make a
> directory /usr/local/data, and put the char_set file there.
>
> The file consits of encoding schemes.
>
> Would it be better to put the data in /etc?
>

according to the FHS (File Hierarchy Standards) used by Linux distributio=
ns=20
data that is architecture neutral and usable by multiple installations=20
belongs in /usr/share/<something>/ (or in your case=20
/usr/local/share/<something>).

/etc is for configuration data that you expect the sysadmin to want to=20
change/add/remove/whatever.

> 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=
=20
wants to instll your program in say /opt/program/ they can.