• 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 Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTask Question


  • Subject: Re: NSTask Question
  • From: Tom Harrington <email@hidden>
  • Date: Tue, 22 Jun 2004 14:29:33 -0600

On Jun 22, 2004, at 1:50 PM, Glenn Zelniker wrote:
I am using NSTask and NSPipe to wrap a unix command in a GUI. I've followed most of the standard examples that use pipes to handle stdin, stdout, and stderr and they make sense to me. But how do I deal with interaction after the task is launched? For example, let's say I'm trying to wrap something like scp that can't be passed a password from the command line. How can I direct the password prompt to the GUI and send it back to the task? Should I parse the NSData coming up the pipe and look for the substring "password", or is there a slicker way to do this?

Unless someone has written a Cocoa "Expect.framework" that I don't know about, this is probably the only good solution.

Come to think of it, I suppose you could use /usr/bin/expect to handle some of the fine points of doing this. But that might just make things more complex. Still, "man expect" might be worth a look for you.

--
Tom Harrington
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >NSTask Question (From: Glenn Zelniker <email@hidden>)

  • Prev by Date: Re: NSTask Question
  • Next by Date: Re: Authenticating without UI
  • Previous by thread: Re: NSTask Question
  • Next by thread: Really Big Windows and Interrupting computations?
  • Index(es):
    • Date
    • Thread