Xref: utzoo comp.bugs.sys5:378 comp.unix.microport:262 comp.unix.xenix:1697 Path: utzoo!mnetor!uunet!husc6!encore!boykin From: boykin@encore.UUCP (Joe Boykin) Newsgroups: comp.bugs.sys5,comp.unix.microport,comp.unix.xenix Subject: Re: FIFOs break tar, others Message-ID: <2795@encore.UUCP> Date: 16 Mar 88 23:31:06 GMT References: <1512@sugar.UUCP> Sender: news@husc6.harvard.edu Reply-To: boykin@encore.UUCP (Joe Boykin) Organization: Encore Computer Corp, Marlboro, MA Lines: 31 Summary: Easy to fix In article <1512@sugar.UUCP> karl@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@multimax.arpa