Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!ihnp4!zehntel!hplabs!sdcrdcf!sdcsvax!akgua!mcnc!decvax!cca!ima!haddock!johnl From: johnl@haddock.UUCP Newsgroups: net.unix Subject: Re: tar .vs. cpio - (nf) Message-ID: <226@haddock.UUCP> Date: Fri, 10-Aug-84 23:42:20 EDT Article-I.D.: haddock.226 Posted: Fri Aug 10 23:42:20 1984 Date-Received: Tue, 14-Aug-84 01:10:48 EDT Lines: 34 #R:ucbopal:-19800:haddock:16700033:000:1189 haddock!johnl Aug 10 12:45:00 1984 >Could someone justify the existence of cpio? What's wrong with tar? There's nothing wrong with tar, but I like cpio better because it is a lot more powerful than tar: - reading file names from stdin is a feature, not a bug. You can use find to enumerate just the files you want rather than having to dump everything in a directory tree, e.g. $ find somedir -mtime -14 -print | cpio -oB >/dev/rmt0 (dump only files modified within the last two weeks.) Doing this with tar is pretty hard. For the most common cases of cpio, we usually have little shell scripts. Also (hack) the find command has a little of cpio built into it so the above example could be: $ find somedir -mtime -14 -cpio /dev/rmt0 - cpio knows about special files and FIFOs. Most versions of tar don't. Could be fixed, of course. - cpio -p lets you copy a directory tree by linking (so that you have new names but the same files.) Tar can't do that. Basically, anything you can do with tar, you can do with cpio but not the converse. John Levine, ima!johnl PS: I offer no defense of the internal coding style of cpio, which still has innumerable MERT-isms. Ugh.