Re: NSTask and uudecode
Re: NSTask and uudecode
- Subject: Re: NSTask and uudecode
- From: Jens Alfke <email@hidden>
- Date: Wed, 27 Jan 2010 09:49:31 -0800
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 (email@hidden)
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:
This email sent to email@hidden