roeder@sbsvax.UUCP (Edgar Roeder) (01/13/90)
In article <47fb17d2.81da@digital.sps.mot.com>, chen@digital.sps.mot.com (Jinfu Chen) writes: > It's much easier to write a program to identify the compression format > and call appropriate compression program to handle the data file. Under UNIX, > this is trival as each of these four compression schemes has an unique 'magic' > number. The UNIX command `file' can be used for such application. If you add > following lines in the 'magic' file (/etc/magic), the command should be able > to identify the format of an compressed file: > [omitted entries for /etc/magic file] If somebody is interested: i have done a port of this file-program some time ago when it was posted to comp.sources.unix. I have also collected some magic numbers used by st-programs. The program can be used to identify files as executables, objects, sources for some language and even to provide informations about them like name of the font in a GDOS font file or size of the various sections (TEXT, DATA, BSS) in executables. If i get enough requests, i could post the binary and/or source to the comp.{binaries,sources}.atari.st group (of course with all the collected st-specific entries for /etc/magic). - Edgar -- Mail: Edgar R\"oder E-Mail: roeder@cs.uni-sb.de Liesbet-Dill-Stra\ss e 3 D-6602 Dudweiler -o- -o- W-Germany ^ Phone: 06897/74643 '---'