• 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: Ingvar Nedrebo <email@hidden>
  • Date: Fri, 5 Sep 2008 09:09:06 +0100

On Sep 4, 2008, at 03:53, Paul Archibald wrote:

Hey folks,

MyApp is a GUI to a command line program (CLP) to which I do not have the source code. MyApp asks the user to select a directory, makes a list of the files in that directory, and calls the CLP for each file. The CLP processes the file(s), reporting its progress to the console with a message like "filename : block 2 finished" until it is finished "filename : finished." I use that output to inform the progressbars and other elements of my GUI.

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. I am using the TaskWrapper class from the Moriarity sample to execute my tasks. Here is how TaksWrapper sets up the NSTask that it uses:


Paul,

If you want to try the pseudo-tty route, I wrote some example code a while ago that demonstrates this. The code is very similar in structure to Apple's Moriarity example, except for using pseudo-ttys instead of pipes.

You can find PseudoTTY.zip at <http://idisk.mac.com/inedrebo>

i.

_______________________________________________
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


References: 
 >trying to control the output of a subprocess. (From: Paul Archibald <email@hidden>)

  • Prev by Date: Re: Perplexed about "call of overloaded 'xxx' is ambiguous"
  • Next by Date: libsyncml / embed library in xcode
  • 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