June 3, 1991; Richard Goerwitz
This file is in the public domain.
PURPOSE: Maps 15+ char. filenames in a tar archive to 14 chars.
Handles both header blocks and the archive itself. Mtf is intended
to facilitate installation of tar'd archives on systems subject to
the System V 14-character filename limit.
USAGE: mtf inputfile [-r reportfile] [-e .extensions] [-x exceptions]
"Inputfile" is a tar archive. "Reportfile" is file containing a
list of files already mapped by mtf in a previous run (used to
avoid clashes with filenames in use outside the current archive).
The -e switch precedes a list of filename .extensions which mtf is
supposed to leave unscathed by the mapping process
(single-character extensions such as .c and .o are automatically
preserved; -e allows the user to specify additional extensions,
such as .pxl, .cpi, and .icn). The final switch, -x, precedes a
list of strings which should not be mapped at all. Use this switch
if, say, you have a C file with a structure.field combination such
as "thisisveryverybig.hashptr" in an archive that contains a file
called "thisisveryverybig.h," and you want to avoid mapping that
portion of the struct name which matches the name of the overlong
file (to wit, "mtf inputfile -x thisisveryverybig.hashptr"). To
prevent mapping of any string (including overlong filenames) begin-
ning, say, with "thisisvery," use "mtf inputfile -x thisisvery."
Be careful with this option, or you might end up defeating the
whole point of using mtf in the first place.
OUTPUT FORMAT: Mtf writes a mapped tar archive to the stdout.
When finished, it leaves a file called "map.report" in the current
directory which records what filenames were mapped and how. Rename
and save this file, and use it as the "reportfile" argument to any
subsequent runs of mtf in this same directory. Even if you don't
plan to run mtf again, this file should still be examined, just to
be sure that the new filenames are acceptable, and to see if
perhaps additional .extensions and/or exceptions should be
specified.
BUGS: Mtf only maps filenames found in the main tar headers.
Because of this, mtf cannot accept nested tar archives. If you try
to map a tar archive within a tar file, mtf will abort with a nasty
message about screwing up your files. Please note that, unless you
give mtf a "reportfile" to consider, it knows nothing about files
existing outside the archive. Hence, if an input archive refers to
an overlong filename in another archive, mtf naturally will not
know to shorten it. Mtf will, in fact, have no way of knowing that
it is a filename, and not, say, an identifier in a C program.
Final word of caution: Try not to use mtf on binaries. It cannot
possibly preserve the correct format and alignment of strings in an
executable. Same goes for compressed files. Mtf can't map
filenames that it can't read!
Source code |
Program Library Page |
Icon Home Page