gabriel rosenkoetter on Fri, 11 Apr 2003 16:00:21 -0400


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Linux FIFOs


On Fri, Apr 11, 2003 at 03:12:22PM -0400, Eric Lucas wrote:
> In the case of ASCII files isn't that an EOF character?

As has been pointed out, there is no EOF character in ASCII. Really,
there isn't. See ascii(7). There isn't even one if you cheat and
include 8 bits rather than 7 (but you'll have to take my word for
that part).

> When it receives that character, the reading program 
> stops reading?

Um, sure, but what character do you think that is? 0x00? 0xff?
Somewhere in between?

> I thought (danger, danger!) that was what happened when you did a 
> "close OUTPUT ;" in the perl script writing the signature
> to the FIFO.

Why would closing a file handle only the writer can see do anything
to the reader's perception of reality? That'd lead to some intensely
broken situations, when all you wanted out of the close(2) was a
buffer flush...

Now if the reader is a *child* of the writer, then that close(2)
might matter (depending on whether you fork(2)ed or vfork(2)ed;
don't recall whether Perl does one, the other, or both; also
depending on what you've done with your memory space *after* forking),
but at that point you should be using SysV shmem for IPC not a
FIFO, since it's cheaper anyhow.

-- 
gabriel rosenkoetter
gr@eclipsed.net

Attachment: pgpJw81VBViEs.pgp
Description: PGP signature