From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mike Gran Newsgroups: gmane.lisp.guile.user Subject: Re: Guile 100 Prob #4 TAR files Date: Sat, 4 May 2013 19:47:44 -0700 (PDT) Message-ID: <1367722064.10663.YahooMailNeo@web120406.mail.ne1.yahoo.com> References: <1364881046.29074.YahooMailNeo@web120401.mail.ne1.yahoo.com> <87sj22e3ay.fsf@tines.lan> Reply-To: Mike Gran NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1367722079 3398 80.91.229.3 (5 May 2013 02:47:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 5 May 2013 02:47:59 +0000 (UTC) Cc: Guile User To: Mark H Weaver Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun May 05 04:47:57 2013 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UYozU-0001yG-Tt for guile-user@m.gmane.org; Sun, 05 May 2013 04:47:57 +0200 Original-Received: from localhost ([::1]:36712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYozU-0003ve-Hf for guile-user@m.gmane.org; Sat, 04 May 2013 22:47:56 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYozL-0003vO-LF for guile-user@gnu.org; Sat, 04 May 2013 22:47:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UYozK-0006Ng-L2 for guile-user@gnu.org; Sat, 04 May 2013 22:47:47 -0400 Original-Received: from nm10-vm2.bullet.mail.ne1.yahoo.com ([98.138.90.158]:47472) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYozK-0006KN-9C for guile-user@gnu.org; Sat, 04 May 2013 22:47:46 -0400 Original-Received: from [98.138.226.179] by nm10.bullet.mail.ne1.yahoo.com with NNFMP; 05 May 2013 02:47:44 -0000 Original-Received: from [98.138.89.195] by tm14.bullet.mail.ne1.yahoo.com with NNFMP; 05 May 2013 02:47:44 -0000 Original-Received: from [127.0.0.1] by omp1053.mail.ne1.yahoo.com with NNFMP; 05 May 2013 02:47:44 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 445093.94641.bm@omp1053.mail.ne1.yahoo.com Original-Received: (qmail 16729 invoked by uid 60001); 5 May 2013 02:47:44 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1367722064; bh=0ArnIql0f4sWQvBWlfHiagQxFtLJolOOlR+etQjLszk=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=hMw4pk6zQYxqjEUKbicoQMybt6+3Yqq1u2Ij4orsRCkHylzuew5yKs3wZSSPlQwDlqB8l4n0MmBJ4s6wrC/IZLNnk3t6CLmElPhu+4S9G0Q/QOzJXJa3Iqmqc5X30wMcOxmE0QfQvnpf38tNCQdV5u3dEqhe09D/mS6skvJBTIo= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=1VhComYJNb6/1hPqP2SLpUoOP+FCUD6H3xPEtFmPVXTcTZvFw9g2leIrEY+tDhQuNV++4/V2Of/LrP+9uFX9Vro1ioZwmFYhyihTXCv1RjDBmyN3HHDwfxbUYY8G2Kbj0GFK9CS3txgZ6nHGq0z3FfrN+GqM7vM/esMEC1EmeYg=; X-YMail-OSG: _bHZQ.sVM1mTjNOz7sDQPwJSrgMO.naLEOTxMvfYEDuP2rd yM68kG4o2rQgYx4qG7NOUoGvlEs1DnvsnxJrxGQ8fn15.TelZxPQAYUmhp6A oHdXNATdYz7Do3YTsxSm2eaqGuKDSqpQtrTDK1i4EULgzoFyvUFiI6i00c1R usJMi_QwzxnKGFsycJpyouYdtvE3IG5ifyOOcXyTMWEYouBCUZYkuFFeUnvQ 0jvuGGKwrQCyuY_WSFEp8R9bndkdYhK_MJRwgHp16GAIb2niKYteYRUjRPHM 5m02eTYb6Mhay_Rw_JS6xDbhm3GRSbU.0swZHFclLcctDc7DsbIzPeNDQnLn TavO9svb3MiAN0hrdoYlPcL7sgLCnKntcOceITUNwtcsJFjIAznuA.3QY6lv kmTYuftp7QD1O.ycgfN5z.GtNyQId5I2wNWqLUZFmE7UUNDul3.t5m_UBy0. F4uRlG1pMc7pxAqHpkAtpwqGZxMr_p3wc08thuAYXW2Uz92fo__eALFtytsR wlF_z8JJeNpJYOOli.DI- Original-Received: from [71.130.221.101] by web120406.mail.ne1.yahoo.com via HTTP; Sat, 04 May 2013 19:47:44 PDT X-Rocket-MIMEInfo: 002.001, PiBGcm9tOiBNYXJrIEggV2VhdmVyIDxtaHdAbmV0cmlzLm9yZz4KCj4gCj4gSSd2ZSBhdHRhY2hlZCBteSBzb2x1dGlvbiB0byBHdWlsZSAxMDAgUHJvYmxlbSAjNDogVEFSIGZpbGVzLsKgIEl0IHNob3VsZAo.IHdvcmsgd2l0aCBHdWlsZSAyLjAuNSBvciBsYXRlci4KPiAKPiBUaGlzIHByb2dyYW0gZG9lcyBtb3JlIHRoYW4geW91IGFza2VkIGZvci7CoCBJdCBhaW1zIHRvIGJlIGEgZnVsbHkKPiBmdW5jdGlvbmFsIHByb2R1Y2VyIG9mIFVTVEFSIGFyY2hpdmVzLCBhbmQgZm9sbG93cyB0aGUgYmVoYXZpb3IBMAEBAQE- X-Mailer: YahooMailWebService/0.8.141.536 In-Reply-To: <87sj22e3ay.fsf@tines.lan> X-detected-operating-system: by eggs.gnu.org: FreeBSD 8.x X-Received-From: 98.138.90.158 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:10310 Archived-At: > From: Mark H Weaver =0A=0A> =0A> I've attached my solutio= n to Guile 100 Problem #4: TAR files.=A0 It should=0A> work with Guile 2.0.= 5 or later.=0A> =0A> This program does more than you asked for.=A0 It aims = to be a fully=0A> functional producer of USTAR archives, and follows the be= havior of GNU=0A> tar with the --format=3Dustar option.=A0 In particular, d= irectories,=0A> symlinks, fifos, and device files are handled as in GNU tar= .=A0 The only=0A> missing feature I'm aware of is hard link detection.=0A= =0AGreat!=0A=0A> =0A> Some notable differences from your specification:=0A>= =0A> * A footer (1024 null bytes) is placed at the end of the entire archi= ve,=0A> =A0 not at the end of each file.=A0 USTAR readers stop reading the = file when=0A> =A0 they find a footer.=0A=0AYou're right that the footer isn= 't at the end of each file.=0A=0A> * The checksum field actually has format= number[7] followed by a space,=0A> =A0 i.e. six octal digits followed by a= NULL and a space.=0A=0AThis one's a bit controversial.=A0 OpenBSD tar uses= 7 octal + NULL.=0AThe Posix description of ustar in pax doesn't mention th= e space, either.=0A=0AI made a few test cases and tried to break your scrip= t, but, I could=0Afind no easy flaw.=A0 Awesome.=A0 I was only testing regu= lar files, though.=0A=0ANot that speed was the point of this exercise, but,= in=0Acreating an archive from 10000 6kB text files, this script was=0Aabou= t 8x slower than GNU tar, and slightly faster than Jez's solution.=0A=0A-Mi= ke=0A