From owner-freebsd-ports Sun Aug 11 14:29:07 1996 Return-Path: owner-ports Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id OAA13987 for ports-outgoing; Sun, 11 Aug 1996 14:29:07 -0700 (PDT) Received: from po1.glue.umd.edu (po1.glue.umd.edu [129.2.128.44]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id OAA13967 for ; Sun, 11 Aug 1996 14:29:04 -0700 (PDT) Received: from thurston.eng.umd.edu (thurston.eng.umd.edu [129.2.103.25]) by po1.glue.umd.edu (8.7.5/8.7.3) with ESMTP id RAA20648; Sun, 11 Aug 1996 17:29:03 -0400 (EDT) Received: from localhost (chuckr@localhost) by thurston.eng.umd.edu (8.7.5/8.7.3) with SMTP id RAA10794; Sun, 11 Aug 1996 17:29:02 -0400 (EDT) X-Authentication-Warning: thurston.eng.umd.edu: chuckr owned process doing -bs Date: Sun, 11 Aug 1996 17:29:00 -0400 (EDT) From: Chuck Robey X-Sender: chuckr@thurston.eng.umd.edu To: patl@asimov.volant.org cc: FreeBSD-Ports@freebsd.org Subject: Re: using tar In-Reply-To: <9608112122.AA01482@asimov.volant.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-ports@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Sun, 11 Aug 1996 patl@asimov.volant.org wrote: > |> > |> cd > |> > |> tar cf - | ( cd ; tar xvfBp - ) > |> > > |> > An arguably better way to copy an entire directory tree within a single > |> > machine is: > |> > > |> > cd > |> > find . -depth -print | cpio -pdmv > |> > |> You aren't the first person to point that method out (Joerg told me about > |> it too) but I hadn't had any argument about it being 'arguably better'. > |> Could/would you expand on that? > > Hmm. It's been a couple of years since I switched over; and I no longer > recall all of the reasons. I believe the most convincing ones involved > the treatment of sparse filenames and very long pathnames, empty directories, > device files, etc. (Most people don't realize that the traditional tar > format has a filename length limit. According to the Solaris man page, > the total length is 255 characters, with no more than 155 for the path > and 100 for the filename. The FreeBSD man page doesn't mention limits; > but FreeBSD uses GNU tar, which can use extended file formats.) > > Using a GNU tar pipe with appropriate options might work as well as the > find|cpio pipe; but it would be a much more cumbersome command. Also, > every byte of every file is read and written twice in the tar|tar pipe. > (Each tar has both diskfile and pipe I/O.) In the find|cpio pipe only > directories are actually read by the find; and only the filenames are > passed through the pipe. That means fewer I/O operations and fewer > context switches; for better performance. Ahh, those do sound like good reasons, ok, I accept the bias then, and I'll start using that idiom. Thanks for the explanation. ----------------------------+----------------------------------------------- Chuck Robey | Interests include any kind of voice or data chuckr@eng.umd.edu | communications topic, C programming, and Unix. 9120 Edmonston Ct #302 | Greenbelt, MD 20770 | I run Journey2 and n3lxx, both FreeBSD (301) 220-2114 | version 2.2 current -- and great FUN! ----------------------------+-----------------------------------------------