Path: utzoo!utgpu!attcan!uunet!mcvax!ukc!dcl-cs!aber-cs!pcg From: pcg@aber-cs.UUCP (Piercarlo Grandi) Newsgroups: comp.unix.wizards Subject: Re: IEEE 1003.2 (was Re: fixing rm * (was: Worm/Passwords)) Summary: ar as the successor to unshar? Message-ID: <396@aber-cs.UUCP> Date: 14 Dec 88 15:12:53 GMT References: <1812@ndsuvax.UUCP> <717@quintus.UUCP> <6518@csli.STANFORD.EDU> <6550@csli.STANFORD.EDU> <145@minya.UUCP> <9137@smoke.BRL.MIL> <33251@think.UUCP> <9154@smoke.BRL.MIL> Reply-To: pcg@cs.aber.ac.uk (Piercarlo Grandi) Distribution: eunet,world Organization: CS Dept., University College of Wales, Aberystwyth, UK (Disclaimer: my statements are purely personal) Lines: 43 In article <9154@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) 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@cs.aber.ac.uk Sw.Eng. Group, Dept. of Computer Science UUCP: ...!mcvax!ukc!aber-cs!pcg UCW, Penglais, Aberystwyth, WALES SY23 3BZ (UK)