Re: Wrapping an Interactive Unix Executable (update)
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