Article View: comp.text.tex
Article #11193Re: Can I add an enty to /etc/magic to make file(1) understand DVI?
From: Ignatios Souvatzis
Date: Thu, 26 Sep 1991 07:43
Date: Thu, 26 Sep 1991 07:43
138 lines
5555 bytes
5555 bytes
Here is the new version of my .../magic append files for TeX users.
New features:
- trying to be byte order independend, as the TeX files are.
- better seperation of byte ordering and ULTRIX extra columns
- a dumb version for very dump file(1) commands
- includes .gf,.pk,.vf and (alas) .pxl support.
Unpacking:
pipe the end of this message, beginning with the '#!/bin/sh' line, to
/bin/sh, or use unshar on the message.
Test:
Pick one of the resulting files and type
file -m <file selected> <list of tex related files>
If the files aren't recognised correctly, pick the next one and go to
test.
If no file remains, tell me... I might think about a solution.
Installation:
append the file you selected in the test step to your
/usr/lib/file/magic, /usr/etc/magic, /etc/magic (check the FILES
section of the file(1) and magic(5) manual pages to find the right
location)
The created files are append-magic (for normal systems),
append-magic-dumb (for dumb systems) and append-magic-ultrix (for
Ultrix >4.1 systems, maybe for others, too)
#!/bin/sh
# to extract, remove the header and type "sh filename"
if `test ! -s ./append-magic-ultrix`
then
echo "writing ./append-magic-ultrix"
cat > ./append-magic-ultrix << '\End\Of\Shar\'
##########################################################################
# TeX support for the file command, to be appended to /usr/lib/file/magic,
# /etc/magic or whatever applies on your system.
# Version 1.5u (26 Sep 1991)
# Copyright 1991 Ignatios Souvatzis (souva@babsy.mpifr-bonn.mpg.de)
# All rights reserved. You may use this file or give it away under
# the conditions of the GNU General Public License, Version 1 or
# later, available from the Free Software Foundation, 675 Mass Ave,
# Campridge, MA 02139, USA. In short, you are allowed to use, alter,
# copy and distribute this file as long as you don't make any profit
# out of it (except for reasonable copying fees), mention that YOU
# made the changes (if you made any) and don't remove this notice from
# it. There is NO WARRANTY --- it will work for you or not, it will
# damage your computer or your health or not.
#########################################################################
#
# TeX:
#
0 string \documentstyle\\%[^}]*}\\% 1,5 LaTeX document %s
# TeX82 binary format:
0 byte 0xF7 1,5 TeX82
>1 byte 0x02 1,5 device independent (.dvi) file
>1 byte 0x03 1,5 right-left device independent (.dvi) file
>1 byte 0x04 1,5 : Impossible! (.dvi file from the future)
>1 byte 0x83 1,5 general font (.gf) file
>1 byte 0x59 1,5 packed font (.pk) file
>1 byte 0xCA 1,5 virtual font (.vf) file
#
# Old pxl format (non conforming to .dvi general format):
# for right endians:
0 long 0x000003E9 1,5 old pixel font (.pxl) file
# for wrong endians:
0 long 0xE9030000 1,5 old pixel font (.pxl) file
# Thou shalt not ask me for a .tfm entry.
# Thou shalt read vftovp.web if thou desirest to know, why.
\End\Of\Shar\
else
echo "will not over write ./append-magic-ultrix"
fi
if [ `wc -c ./append-magic-ultrix | awk '{printf $1}'` -ne 1667 ]
then
echo `wc -c ./append-magic-ultrix | awk '{print "Got " $1 ", Expected " 1667}'`
fi
if `test ! -s ./append-magic.u2n`
then
echo "writing ./append-magic.u2n"
cat > ./append-magic.u2n << '\End\Of\Shar\'
4s/1.5u/1.5n/
18,$s/1,5 //
\End\Of\Shar\
else
echo "will not over write ./append-magic.u2n"
fi
if [ `wc -c ./append-magic.u2n | awk '{printf $1}'` -ne 27 ]
then
echo `wc -c ./append-magic.u2n | awk '{print "Got " $1 ", Expected " 27}'`
else
if `test ! -s ./append-magic`
then
echo "creating append-magic"
/bin/sed -f ./append-magic.u2n append-magic-ultrix > append-magic
echo "removing append-magic.u2n"
/bin/rm -f append-magic.u2n
if `test ! -s ./append-magic.n2d`
then
echo "writing ./append-magic.n2d"
cat > ./append-magic.n2d << '\End\Of\Shar\'
4s/1.5n/1.5d/
19c\
0 string \\documentstyle LaTeX document
\End\Of\Shar\
else
echo "will not over write ./append-magic.n2d"
fi
if [ `wc -c ./append-magic.n2d | awk '{printf $1}'` -ne 59 ]
then
echo `wc -c ./append-magic.n2d | awk '{print "Got " $1 ", Expected " 59}'`
else
if `test ! -s ./append-magic-dumb`
then
echo "creating append-magic"
/bin/sed -f ./append-magic.n2d append-magic > append-magic-dumb
echo "removing append-magic.n2d"
/bin/rm -f append-magic.n2d
else
echo "will not over write ./append-magic-dumb"
fi
fi
else
echo "will not over write ./append-magic"
fi
fi
echo "Finished archive 1 of 1"
exit
--
Paper mail: Ignatios Souvatzis, Radioastronomisches Institut der
Universitaet Bonn, Auf dem Huegel 71, D-5300 Bonn 1, FRG
Internet: u502sou@mpirbn.mpifr-bonn.mpg.de
souva@babsy.mpifr-bonn.mpg.de
Technical Details
Message-ID:
<U502SOU.91Sep26094327@mpirbn.mpifr-bonn.mpg.de>Path:
arc1-ca.pugleaf.net!wupost!uunet!mcsun!unido!mpirbn!u502souReferences:
<949@ltb.ltb.bso.nl> <17637@chopin.udel.edu> <1037@ltb.ltb.bso.nl>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!wupost!uunet!mcsun!unido!mpirbn!u502sou From: u502sou@mpirbn.mpifr-bonn.mpg.de (Ignatios Souvatzis) Newsgroups: comp.text.tex,alt.sources,sub.tex Subject: Re: Can I add an enty to /etc/magic to make file(1) understand DVI? Message-ID: <U502SOU.91Sep26094327@mpirbn.mpifr-bonn.mpg.de> Date: 26 Sep 91 07:43:27 GMT References: <949@ltb.ltb.bso.nl> <17637@chopin.udel.edu> <1037@ltb.ltb.bso.nl> Sender: u502sou@mpirbn.mpifr-bonn.mpg.de Reply-To: u502sou@c1a Distribution: world,alt,sub Organization: /mnt0/u502sou/.organization Lines: 138 Supersedes: <U502SOU.91Sep14153430@mpirbn.mpifr-bonn.mpg.de> In-reply-to: u502sou@mpirbn.mpifr-bonn.mpg.de's message of 14 Sep 91 13:34:30 GMT X-Md4-Signature: 76d9e64e9db67a749f2a627d06ff40c9