On 14 Jun 2013, at 06:40, Jens Alfke <j...@mooseyard.com> wrote:

> 
> On Jun 13, 2013, at 2:17 PM, Rick Mann <rm...@latencyzero.com> wrote:
> 
>> I'd like to be smarter about this in my own apps. Is there a test I can 
>> perform before accessing aliases I've stored, or an async way to open/read 
>> from files that won't block the main thread?
> 
> It’s not opening or reading from the file that’s the slow part, it’s 
> resolving the alias, which happens first. (Aliases aren’t automatic or 
> transparent like symlinks; something has to explicitly recognize a file as an 
> alias and then resolve it to get the destination file’s location.)
> 
> I know the alias APIs have changed in the last few years, and I don’t know 
> the new ones, but I’d imagine there is an async variant. Once you’ve resolved 
> the alias, you can open/read from the file as normal. If you think the actual 
> file I/O might still be too slow, you can do it on a background thread.

There's no async API. I filed a radar asking for this relatively recently and 
was recommended to shove such tasks onto the low priority GCD queue instead.


_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to