From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 12 13:42:21 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 C0261106567C for ; Fri, 12 Dec 2008 13:42:21 +0000 (UTC) (envelope-from rihad@mail.ru) Received: from mx40.mail.ru (mx40.mail.ru [194.67.23.36]) by mx1.freebsd.org (Postfix) with ESMTP id 7DDBE8FC17 for ; Fri, 12 Dec 2008 13:42:21 +0000 (UTC) (envelope-from rihad@mail.ru) Received: from [217.25.27.27] (port=48487 helo=[217.25.27.27]) by mx40.mail.ru with asmtp id 1LB8Hb-000Hcr-00 for freebsd-hackers@freebsd.org; Fri, 12 Dec 2008 16:42:19 +0300 Message-ID: <49426A3A.4070806@mail.ru> Date: Fri, 12 Dec 2008 17:42:18 +0400 From: rihad User-Agent: Icedove 1.5.0.14eol (X11/20080724) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <494235CA.2050101@mail.ru> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: Not detected X-Mras: OK X-Mailman-Approved-At: Fri, 12 Dec 2008 18:22:47 +0000 Subject: Re: preventing FIFO from EOF 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: Fri, 12 Dec 2008 13:42:21 -0000 Danny Braniss wrote: >> $ mkfifo /var/tmp/foo >> $ buffer -i /var/tmp/foo # misc/buffer >> # in another console: >> $ echo hi > /var/tmp/foo >> >> buffer prints hi and exits. I want it to keep reading and printing >> indefinitely. >> >> Further experimentation revealed that I need two writers: one dummy >> writer that just keeps /var/tmp/foo open for writing, and the other >> doing the "real work". This way buffer wouldn't exit. But how to emulate >> the dummy writer? It itself needs to block on something to keep >> /var/tmp/foo open. Any clean way to do this in shell? Maybe the solution >> is quite simple but isn't at the tip of my tongue. >> >> Thanks. > > too easy > n csh: > while 1 > buffer -i /var/tmp/foo > end > or in sh: > while true; do > buffer -i /var/tmp/foo > done > Thanks, but I should have said that buffer must always run to never miss any data.