FIFOs break tar, others

Joe Boykin boykin at encore.UUCP
Thu Mar 17 09:31:06 AEST 1988


In article <1512 at sugar.UUCP> karl at sugar.UUCP (Karl Lehenbauer) writes:
>Tar will hang when it tries to open FIFOs.  Cpio and even 'cp' will
>too, but the find command that is typically piped into 'cpio -o' can 
>do a '-type f' so cpio'll never see the FIFO and it could be argued
>that 'cp' should not have to look at file types.  Well and good.
>
>tar, unfortunately, cannot be told to ignore or to properly "copy" FIFOs.
>-- 
>"Lack of skill dictates economy of style." - Joey Ramone
>..!uunet!nuchat!sugar!karl, Unix BBS (713) 438-5018

The fix to tar is easy, so easy that I posted a fix to this a long time ago!

Basically, one of the first things done in the routine 'putfile' is a 'stat'
of the file you're going to write to tape.  The simple change is to put some
code int which looks like this:

	if((stbuf.st_mode & S_IFMT) == S_IFIFO)
		return;

Another version of tar which I've seen doesn't do a 'stat' first, but
does an open.  On this version I added the O_NDELAY flag and put in
similar code.

----

Joe Boykin
Encore Computer Corp

UUCP: encore!boykin
ARPA: boykin at multimax.arpa



More information about the Comp.unix.microport mailing list