On Jan 27, 2010, at 9:37 AM, gMail.com wrote:
I have to decode a uuencoded NSString in memory so I use NSTask to
launch
the unix command uudecode.
Why not just use a C function to uudecode? A minute's googling turned up
http://en.literateprograms.org/UUencode_(C)
I cannot later get any data with
NSData *dataOut = [readHandle availableData];
The application doesn't go further. It remains blocked here.
I'm not certain what's going wrong, but you might actually be blocked
in the waitUntilExit call above? IIRC, pipes have a fixed capacity, so
if you're not reading the data out of the pipe, the task will block
after it fills it up, causing a deadlock.
NSTask can be surprisingly difficult to get working correctly. I would
recommend against using it if you can do the operation in-process.
—Jens_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to arch...@mail-archive.com