Re: Reading FIFOs one character at a time
From: JQ (foo_at_bar.com)
Date: 08/31/04
- Next message: JQ: "Re: message queueing on AIX 5.2"
- Previous message: Norm Dresner: "Re: stand-alone binary"
- In reply to: Peter Ammon: "Reading FIFOs one character at a time"
- Next in thread: Norm Dresner: "Re: Reading FIFOs one character at a time"
- Reply: Norm Dresner: "Re: Reading FIFOs one character at a time"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 30 Aug 2004 20:21:03 -0700
Peter Ammon wrote:
> I would like to write a program to read a FIFO (named pipe) one
> character per invocation. When I attempt to read the first character,
> the writing process finishes its write and terminates, and the first
> character is successfully read. However, the remaining data is lost.
Depending on the OS, a named pipe like this has an internal kernel
buffer. 512 bytes, 4096 bytes, and 32768 bytes I've seen. The OS will
also signal the writer once the reader terminates and thus will bit
bucket the remaining data left in the FIFO.
You've got two problems here, one is the indeterminate FIFO kernel
buffer and the other other is signals between the two processes. I
would suggest you use a message queue a la SysV IPC or some like to
accomplish what you want.
-- JQ
- Next message: JQ: "Re: message queueing on AIX 5.2"
- Previous message: Norm Dresner: "Re: stand-alone binary"
- In reply to: Peter Ammon: "Reading FIFOs one character at a time"
- Next in thread: Norm Dresner: "Re: Reading FIFOs one character at a time"
- Reply: Norm Dresner: "Re: Reading FIFOs one character at a time"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|