Re: trying to control the output of a subprocess.
Re: trying to control the output of a subprocess.
- Subject: Re: trying to control the output of a subprocess.
- From: Greg Guerin <email@hidden>
- Date: Thu, 4 Sep 2008 07:49:28 -0700
Paul Archibald wrote:
Well, it worked fine up until now, when I am doing some testing and
am launching MyApp from the Finder instead of from Xcode. Now, the
progress output is being buffered until the CPL is finished with
the file, and then spewing out the entire buffer (which MyApp has
been intercepting). This is abd for me since I need that line by
line output.
I have seen some posts on the Cocoa and Xcode lists that mention
similar problems, but I can't find one that explains how to fix it.
IIRC, one way to fix it is to use a pseudo-tty (man 4 pty) instead of
a pipe. The way pty's work, they can stream data between processes,
like a pipe, but appear to be a tty in all other respects (man 4
tty). Since most programs will line-buffer tty streams, a typical
side-effect is line-buffered inter-process streams.
Depending on which command is being run, it might also have a command-
line option that tells it to not buffer output. You'd have to read
the man page for the command, and probably search for the word "buffer".
-- GG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden