• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTask and uudecode
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSTask and uudecode (From: "gMail.com" <email@hidden>)

  • Prev by Date: Re: Context menu on NSOutlineView, which row is active/selected?
  • Next by Date: Re: NSTask and uudecode
  • Previous by thread: NSTask and uudecode
  • Next by thread: Re: NSTask and uudecode
  • Index(es):
    • Date
    • Thread