Next: , Previous: , Up: Units Conversion   [Contents][Index]


17 Data Files

The units program uses four default data files: the main data file, definitions.units; the atomic masses of the elements, elements.units; currency exchange rates, currency.units, and the US Consumer Price Index, cpi.units. The last three files are loaded by means of ‘!include’ directives in the main file (see Database Command Syntax). The program can also use an optional personal units data file .units (unitdef.units under Windows) located in the user’s home directory. The personal units data file is described in more detail in Units Data Files.

On Unix-like systems, the data files are typically located in /usr/share/units if units is provided with the operating system, or in /usr/local/share/units if units is compiled from the source distribution. Note that the currency file currency.units is a symbolic link to another location.

On systems running Microsoft Windows, the files may be in the same locations if Unix-like commands are available, a Unix-like file structure is present (e.g., C:/usr/local), and units is compiled from the source distribution. If Unix-like commands are not available, a more common location is C:\Program Files (x86)\GNU\units (for 64-bit Windows installations) or C:\Program Files\GNU\units (for 32-bit installations).

If units is obtained from the GNU Win32 Project (http://gnuwin32.sourceforge.net/), the files are commonly in C:\Program Files\GnuWin32\share\units.

If the default main units data file is not an absolute pathname, units will look for the file in the directory that contains the units program; if the file is not found there, units will look in a directory ../share/units relative to the directory with the units program.

You can determine the location of the files by running ‘units --version. Running ‘units --info will give you additional information about the files, how units will attempt to find them, and the status of the related environment variables.


Next: Unicode Support, Previous: Environment Variables, Up: Units Conversion   [Contents][Index]