• 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: Andrew Farmer <email@hidden>
  • Date: Fri, 6 Feb 2009 00:06:35 -0800

On 05 Feb 09, at 22:10, Ken Thomases wrote:
On Feb 5, 2009, at 10:48 PM, xEsk PiV wrote:
I'm using NSTask for executing a command line tool, but I'm having
some troubles getting the entire output.

I explain the situation:

1) When I execute the command line tool using the Terminal, the tool
while is working it displays an ASCII progress bar (single line).

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).


When you capture the output, the output is not a tty, so the tool doesn't display the progress bar.

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


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'?

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.

'man forkpty' is the place to start. _______________________________________________

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: xEsk PiV <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>)

  • Prev by Date: Re: Quicktime Movie View error
  • Next by Date: control app with help iphone?
  • 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