Dumping input to NSTask
Dumping input to NSTask
- Subject: Dumping input to NSTask
- From: John Timmer <email@hidden>
- Date: Wed, 14 Jul 2004 19:19:08 -0400
Greetings -
I'm trying to execute a program via NSTask that works normally by launching,
grabbing input, and then printing output and executing. Typically, I'd
create the input as a text file, then run the program like:
cat inputFile | /path/to/my/program
In trying to do that via NSTask, I've created the input as a string, then
use the string to create an NSData (using UTF8), and then send that through
the task's standard input file handle. The problem is that the task hangs -
it seems to be waiting for the input to terminate, but if I close the file
handle, I crash with invalid memory access.
Any suggestions?
JT
_______________________________________________
This mind intentionally left blank
_______________________________________________
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.