Skip navigation.
 
mlRe: NSTask not completing
FROM : Gerd Knops
DATE : Mon Mar 10 22:39:53 2008

On Mar 6, 2008, at 2:35 PM, Charles Ross wrote:

>

[..]

> If I enter the following command in the terminal, it returns about 
> 20,000 records to the screen in about one second:
>
> sqlite3 Videos.sql 'select * from ZVIDEOS'
>
> The file has a fairly large number of records, almost 20,000. 
> However, the following code, when run from a simple Foundation Tool 
> I built to figure out what's going on, never gets to the second 
> NSLog statement, even after running for more than ten minutes. Is 
> this process really taking that long or am I missing something?
>

You need to read the data before the task can finish.

Simplest case:

...
   [t launch];
   NSLog(@"t launched");
   NSData *d=[fh readDataToEndOfFile]; // <-- read here!
   [t waitUntilExit];
   NSLog(@"done waiting");

Gerd

Related mailsAuthorDate
mlNSTask not completing Charles Ross Mar 6, 21:35
mlRe: NSTask not completing Jens Alfke Mar 6, 22:06
mlRe: NSTask not completing Gerd Knops Mar 10, 22:39