Re: NSTask troubles
Re: NSTask troubles
- Subject: Re: NSTask troubles
- From: Timothy Klein <email@hidden>
- Date: Thu, 12 Jul 2007 17:50:13 -0600
On 12 Jul 2007, at 5:16 PM, Alastair Houghton wrote:
On 13 Jul 2007, at 00:04, John Stiles wrote:
Well, I think I understand what you're saying here—atos' output is
queued up and not being sent back to me—but do you know how to
work around the issue? Reading the docs, I only see two semi-
promising approaches: do an fsync on the file descriptor, or call -
synchronizeFile on the pipe's NSFileHandle.
I'll try these, but I'm still not sure why this would work fine on
Intel…
It probably isn't the pipe buffer that's causing you trouble here.
If the problem is the output buffering in the C runtime (which I
think you'll find it is), then neither of those will solve it.
There are three fixes that will work:
I've had annoying and perplexing problems with NSTask as well, but
this statement confuses me.
read() and write() are system calls into the kernel, no? And thus
should not have any associated C-std-library buffers in the way,
should they? ( They are in manual section 2, which is for system
calls, and Steven's APUE lists them as unbuffered IO).
Is that right, or am I confused? Or is the buffering happening
somewhere else? (and if so, *where*?).
--
Timothy Klein
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden