Piping TAR

Anthony DeBoer adeboer at gjetor.geac.COM
Fri May 10 00:32:54 AEST 1991


In <1991May7.001920.21111 at mrspoc.Transact.COM> steven at Transact.COM writes:
>rembis at nic.cerf.net (Michael Rembis) writes:
>>Hi. I need some help on a PC based XENIX system running version 2.3.
>>I am trying to relocate a tar file that is on the hard disk out to
>>a set of floppies.  I have tried things like   tar xf FILE | (tar cv2 -)
>>and other combinations of that command with no luck. Does anyone know
>>the right sequence to initiate this ?
>
>Unfortunately, you can't do it without first extracting the files from
>the archive and then creating the floppy archive.  TAR writes to separate
>files when it extracts.  There's no way to tell it to just copy the files
>with all their headers to floppies.  :^(

If it were an archive small enough to fit on a single diskette, you might be
in luck.  Unfortunately, as you say, it needs a set of floppies, so you need
to break the archive up.  One thing that I've done with a single-diskette
archive before (at least with cpio, and at this level there oughtn't to be a
difference), is to use dd to read the archive from the hard disk (or even, if
it was compressed, to zcat it and pipe that to dd) and have dd write it to
diskette.  Something like:

$ dd if=foo of=/dev/rfd0135ds18 obs=18k conv=sync
$ zcat foo | dd of=/dev/rfd0135ds18 obs=18k conv=sync

You'd need to spend a little while with the dd man page and check out the
exact options.  From memory, those should be the right options with a 3.5"
diskette, but your mileage may vary.

Since tar is supposed to always put headers on block boundaries, you could
play with the skip=nn and count=nn options and snip out sections of your
archive directly to diskette, but this may be the hard way of doing it.
-- 
Anthony DeBoer NAUI#Z8800 | adeboer at gjetor.geac.com   | Programmer (n): One who
Geac J&E Systems Ltd.     | uunet!geac!gjetor!adeboer | makes the lies the 
Toronto, Ontario, Canada  | #include <disclaimer.h>   | salesman told come true.



More information about the Comp.unix.xenix.sco mailing list