From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 25 22:00:48 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34A7116A40E for ; Mon, 25 Feb 2008 22:00:48 +0000 (UTC) (envelope-from xfb52@dial.pipex.com) Received: from mk-outboundfilter-1.mail.uk.tiscali.com (mk-outboundfilter-1.mail.uk.tiscali.com [212.74.114.37]) by mx1.freebsd.org (Postfix) with ESMTP id C914713C4E1 for ; Mon, 25 Feb 2008 22:00:47 +0000 (UTC) (envelope-from xfb52@dial.pipex.com) X-Trace: 48440314/mk-outboundfilter-1.mail.uk.tiscali.com/PIPEX/$INTERNET-ACCEPTED/None/62.31.10.181 X-SBRS: None X-RemoteIP: 62.31.10.181 X-IP-MAIL-FROM: xfb52@dial.pipex.com X-IP-BHB: Once X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAACfCwkc+Hwq1/2dsb2JhbAAIq2c X-IP-Direction: OUT Received: from 62-31-10-181.cable.ubr05.edin.blueyonder.co.uk (HELO [192.168.23.2]) ([62.31.10.181]) by smtp.pipex.tiscali.co.uk with ESMTP; 25 Feb 2008 21:30:45 +0000 Message-ID: <47C33384.6040701@dial.pipex.com> Date: Mon, 25 Feb 2008 21:30:44 +0000 From: Alex Zbyslaw User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-GB; rv:1.7.13) Gecko/20061205 X-Accept-Language: en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <20080225154455.4822e72a@bhuda.mired.org> In-Reply-To: <20080225154455.4822e72a@bhuda.mired.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: emulate an end-of-media X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2008 22:00:48 -0000 Mike Meyer wrote: >On Mon, 25 Feb 2008 21:19:33 +0100 "Martin Laabs" wrote: > > >>Hi, >> >>On Mon, 25 Feb 2008 20:34:31 +0100, wrote: >> >> >> >>>You might want to play with the -P option to dump. Your above could be >>>written as: >>> >>>dump -aL0 -P 'compress -c' /MYFILESYSTEM | cdrecord dev=... - >>> >>> >> Why compress? It's ancient technology and will be vastly outperformed by gzip (and bzip2 but that's slower). >>>Assuming that compress -c & cdrecord play nice (which your magic >>>device solution also requires) >>> >>> >>My solution can just close the pipe at the one "end" of the magic >>device which would be realy simple to implement in a script. >> >> > >While you're proposing a magic device that catches sigpipe, and >delivers an EOM to make dump -a happy. I'm proposing that dump catch >the sigpipe, and treat it like an EOM if it has -a. This may be >non-workable, in that you have to be able to tell if it was the -P >process or a slave process that generated the sigpipe, but I think >it's the best solution. > > Are there not (at least) two more alternatives? 1) Add gzip/zlib support to dump. That would seem easier than new devices. Then -a would just work. 2) Instead of using cdrecord directly you have a wrapper which "emulates" the dump -a behaviour by writing 650/700Mb of data using cdrecord then prompting for the next cd. You don't close the pipe, and dump should just block waiting for your "device" to be ready. Might have trouble accessing /dev/tty - not sure. --Alex