• 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: Wrapping an Interactive Unix Executable (update)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wrapping an Interactive Unix Executable (update)


  • Subject: Re: Wrapping an Interactive Unix Executable (update)
  • From: Erik Mendoza <email@hidden>
  • Date: Fri, 17 Dec 2004 22:56:07 -0800

I guess I just didn't expect to have to do this since the program works just fine without the newline if the NSTask is launched without a standardInput but with the word to be translated as an argument. I suppose in this situation NSTask knows to execute the task once and supplies the newline.

Thanks for all of the help, everyone. I think I'm going to leave the program as is (i.e. with NSTask being run once for each argument) since upon further studying the documentation for the translation app I realized that it's designed to run as both a one shot deal and interactively. So, now I don't have to worry about the output being mangled or anything, or any notification center stuff. But rest assured your help was not in vain, as I've learned a tremendous deal.

Erik


On Dec 17, 2004, at 22:27, Steven Palm wrote:


On Dec 17, 2004, at 3:59 PM, Erik Mendoza wrote:
I take it you meant I should add a carriage return to the input string? Well, I did, and lo and behold it worked! However, the output is mangled, and in different ways each time. I think this may have to do with the fact that the Unix app outputs a number of lines of output, as opposed to just one (sort of like ls). Hopefully this problem won't take too long to figure out.

Yes, that is what I meant. Most command line utils won't process the input buffer until you terminate it. I wonder if you'd have any luck setting the environment variables in the NSTask before you launch it, in particular to maybe set the TERM variable to dumb or something similar so the program doesn't try to do any fancy output formatting...


 Steve



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Re: Wrapping an Interactive Unix Executable (update) (From: email@hidden)
 >Re: Wrapping an Interactive Unix Executable (update) (From: Erik Mendoza <email@hidden>)
 >Re: Wrapping an Interactive Unix Executable (update) (From: Steven Palm <email@hidden>)

  • Prev by Date: Re: Wrapping an Interactive Unix Executable (update)
  • Next by Date: Re: NSAlert strategy advice
  • Previous by thread: Re: Wrapping an Interactive Unix Executable (update)
  • Next by thread: Re: Wrapping an Interactive Unix Executable (update)
  • Index(es):
    • Date
    • Thread