IEEE 1003.2 (was Re: fixing rm * (was: Worm/Passwords))

Piercarlo Grandi pcg at aber-cs.UUCP
Thu Dec 15 01:12:53 AEST 1988


In article <9154 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>)
writes:

    But MY point is that "ar" is practically the ONLY UNIX utility to have
    been hammered over the years into producing a completely portable format
    (when used for text files).

I do agree! Ar format is the great obscure portable format!

    Even cpio -c and tar formats fail to be as portable.

I have a small reservation about this.  Actually (and unfortunately) ar(5) is
not as portable in practice as it is in theory.

The problem is that the length of each archive member is encoded in its
header, so that if tabs are (un)expanded or lines get padded to a fixed
length or trailing white space is trimmed, you are quite out of luck.
(as in uploading/downloading something using cu/tip to/from a "dumb" system).

Of course you can still recognize the member headers by the leading "magic
string" and check for the subsequent structure, but existing ar(1) utilities
rely absolutely on the chacter count.

Another archival format, Unix mailbox format, is, as far as I can see,
absolutely portable, but then it is not especially convenient for storing
files (well, I do that, for sources fished off the net).

All this discussion of portability, to one end: there have been some
complaints about the shar file format, and a search for alternatives. In my
view ar(5) format can be a very good alternative; if no funny things are
expected on white space, ar(5) is probably the best format, as virtually
everybody has ar(1) extractor or can build one in virtually no time (using
shell scripts...), and at worst, you can just edit the ar(5) file.

Mailbox format is an alternative, as there are lots of mailers that
understand it and can give a nice view of a mailbox archive. Extraction to
named file is less easy, and usually has to be manual (e.g. by using the "w"
command in Mail/mailx), and you have to undo manually any '>' insertion
done before lines beginning with "From " in you files.
-- 
Piercarlo "Peter" Grandi			INET: pcg at cs.aber.ac.uk
Sw.Eng. Group, Dept. of Computer Science	UUCP: ...!mcvax!ukc!aber-cs!pcg
UCW, Penglais, Aberystwyth, WALES SY23 3BZ (UK)



More information about the Comp.unix.wizards mailing list