/etc/magic
The UNIX command file(1)
determines the type of a file by
examining its contents. By modifying the file /etc/magic
, which
records characteristics of files that file(1)
recognizes,
file(1)
can be used to identify QOF files and QOF files that
are saved states.
The sys
component postinstall script attempts to modify this
file, adding the following lines to the end:
0 string QOF Quintus Prolog Object File, >10 short x Ver %d >8 short x Rev %d >12 long 0x04030201 (byte-swapped) 256 string QOF Quintus Prolog Saved-state, >266 short x Ver %d >264 short x Rev %d >268 long 0x04030201 (byte-swapped)
If /etc/magic
has been updated, and the file camerton.qof
is a
QOF file that has been built using Quintus Prolog Release 3.5, you
should see:
% file camerton.qof camerton.qof: Quintus Prolog Object File; Ver 1 Rev 71
If you do not install the sys
component on your system
then the same effect can be achieved by creating your own copy of
the system's /etc/magic
file and adding the above lines to it.
Your version of /etc/magic
can then be used with the -m
option to file(1)
to recognize QOF files. If you have made
your own copy of /etc/magic
in ~/mymagic
and modified that
copy as suggested, you can type:
% file -m ~/mymagic camerton.qof camerton.qof: Quintus Prolog Object File; Ver 1 Rev 71