• 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: NSTask + incomplete stdout at end of process
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTask + incomplete stdout at end of process


  • Subject: Re: NSTask + incomplete stdout at end of process
  • From: xEsk PiV <email@hidden>
  • Date: Fri, 6 Feb 2009 14:49:03 +0100

Thanks Ken,

I suspect the tool, or the library it is using for output (ncurses?), is
> detecting whether or not its output is a terminal device (tty).


How can I know it?

What happens if you run the tool at the shell but redirect its output to: 1)
> a file, or 2) a pipe to 'less', 'more', or 'open -e'?


I tried the opt. 1), redirecting the output to a TXT file (ie: upx
to_compress > output.txt) and the final result is the same as I get after
execute the NSTask and capture the output.

You can create a pseudo-tty if you really need to convince the tool that its
> output is a tty.  I don't know much about it, but I gather it's not simple.


Uh...


Thanks Adrew,

The other possibility that comes to mind is that the progress bar is being
> output to standard error.


No, I also capture the stderr, and when the command tool fails the stderr is
filled up with error msg, so seems work correctly.

'man forkpty' is the place to start.


I've taken a look to this, and it exceeded me, I didn't understand almost
anything...


When I started I hoped that capturing the output was  easy as other
frameworks xD

Cheers,
Xesc.
_______________________________________________

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

  • Follow-Ups:
    • Re: NSTask + incomplete stdout at end of process
      • From: Ken Thomases <email@hidden>
References: 
 >NSTask + incomplete stdout at end of process (From: xEsk PiV <email@hidden>)
 >Re: NSTask + incomplete stdout at end of process (From: Ken Thomases <email@hidden>)
 >Re: NSTask + incomplete stdout at end of process (From: Andrew Farmer <email@hidden>)

  • Prev by Date: Re: Simple memory problem
  • Next by Date: Re: Simple memory problem
  • Previous by thread: Re: NSTask + incomplete stdout at end of process
  • Next by thread: Re: NSTask + incomplete stdout at end of process
  • Index(es):
    • Date
    • Thread