Date: Mon, 5 Jun 2000 21:48:04 +0100 From: David Malone <dwmalone@maths.tcd.ie> To: Ben Smithurst <ben@scientia.demon.co.uk> Cc: hackers@FreeBSD.org Subject: Re: readers missing EOF on FIFOs. Message-ID: <20000605214804.A61337@walton.maths.tcd.ie> In-Reply-To: <20000605010324.E42325@strontium.scientia.demon.co.uk>; from ben@scientia.demon.co.uk on Thu, Jun 01, 2000 at 05:06:56PM %2B0100 References: <20000605010324.E42325@strontium.scientia.demon.co.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jun 01, 2000 at 05:06:56PM +0100, Ben Smithurst wrote: > For some reason, 'cat' doesn't see EOF when my 'fifotest' program closes > the FIFO. Can someone tell me what I'm doing wrong here please? I didn't check your program, but I did try: mkfifo /tmp/a echo hello > /tmp/a & echo bye > /tmp/a & cat /tmp/a on a selection of systems (FreeBSD, Digital Unix, AIX, Solaris, Linux), and the cat always prints "hello\nbye\n". I think this is the same as what you're seeing in your program - the file is being closed and reopened while the reader has it open, so the writer can continue to write. I'm not sure how you can get around this, other than either the hacky way with the sleep, or maybe by using file locking of some sort. David. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000605214804.A61337>