Re: Piping the result of a Unix command
Re: Piping the result of a Unix command
- Subject: Re: Piping the result of a Unix command
- From: Lorenzo <email@hidden>
- Date: Fri, 03 Oct 2003 20:42:06 +0200
Thank you.
It works beautyfully.
You are a genius.
Best Regards
--
Lorenzo
email: email@hidden
>
From: "Alastair J.Houghton" <email@hidden>
>
Date: Fri, 03 Oct 2003 14:39:31 +0100
>
To: Lorenzo <email@hidden>
>
Cc: Cocoa Forum <email@hidden>, Ben Dougall <email@hidden>
>
Subject: Re: Piping the result of a Unix command
>
>
NSFileHandle *theHandle = [thePipe fileHandleForReading];
>
>
for (;;) {
>
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
>
NSData *dataOut = [theHandle availableData];
>
>
if (![dataOut length]) {
>
/* End of file, so exit */
>
[pool release];
>
break;
>
}
>
>
/* Process the data in "dataOut" */
>
>
[pool release];
>
}
>
>
[task waitUntilExit];
_______________________________________________
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.