Date: Sat, 10 Aug 1996 12:44:52 +0300 (EET DST) From: Narvi <narvi@haldjas.folklore.ee> To: "David E. O'Brien" <obrien@Nuxi.cs.ucdavis.edu> Cc: FreeBSD ports list <freebsd-ports%freebsd.org@sunrise.cs.berkeley.edu> Subject: Re: using tar Message-ID: <Pine.BSF.3.91.960810124013.13368N-100000@haldjas.folklore.ee> In-Reply-To: <199608100929.CAA01408@relay.nuxi.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 10 Aug 1996, David E. O'Brien wrote: > > > > I want to use tar to move a directory hierarchy, but I want to do it > > > > without using a temp directory, and I don't know the syntax to make tar > > > > create an archive to stdout, then read from stdout to extract the acrchive > > > > > > tar -cf - -C $SRCDIR . | tar xpf - -C $DESTDIR > > > > > > Will do the trick. > > > > Why not just mv $SRCDIR $DESTDIR? Yes, if $DESTDIR exist you will have to > > write a for $i in ...; do mv $i $DESTDIR; done? > > Many mv's can't move a directory structure across devices (read disk > partitions) because of the limitations of rename(2). Thus you can only > use mv if $SRCDIR and $DESTDIR are on the same partition. > > For instance, GNU's mv gives: > mv: cannot move `foo' across filesystems: Not a regular file > GNU mv may have problems moving directories between file systems or disks or whatever, but the one in -stable certainly does not. Just to check I move a directory from my home directory (on /usr/home partion on sd0) to /usr/src which is not only on another file system but entirely on another disk (sd1). If this is a bug, not a feature, then *ANYBODY PLEASE DO NOT REMOVE IT*! It is quite handy to have it this way. Sander > > -- David (obrien@cs.ucdavis.edu) >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.960810124013.13368N-100000>