Re: NSFileHandle and FIFO files
Re: NSFileHandle and FIFO files
- Subject: Re: NSFileHandle and FIFO files
- From: Fritz Anderson <email@hidden>
- Date: Wed, 1 Jun 2005 14:01:50 -0500
On 1 Jun 2005, at 1:16 AM, Francisco Tolmasky wrote:
[T]his hangs my app, apperantly because NSFileHandle doesn't like
FIFO files created as so:
NSLog(@"[%d]",mkfifo([path cString], 0644));
fileHandleForReading= [[NSFileHandle fileHandleForReadingAtPath:
path] retain];
As I understand it, an open() on one end of a FIFO blocks until some
other process open()s the other end. I'd suggest either accepting the
blocking behavior, or doing an open() with the O_NDELAY flag set, and
passing the resulting file descriptor to -[NSFileHandle
initWithFileDescriptor:] (or the variant that allows the NSFileHandle
to close the descriptor).
-- F
--
Fritz Anderson
Consulting Programmer
http://resume.manoverboard.org/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden