• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: trying to control the output of a subprocess.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Internal error occurred while creating dependency graph
  • Next by Date: Re: Internal error occurred while creating dependency graph
  • Previous by thread: Re: trying to control the output of a subprocess.
  • Next by thread: Re: trying to control the output of a subprocess.
  • Index(es):
    • Date
    • Thread