Re: Asynchronously mounting a remote file server?
Re: Asynchronously mounting a remote file server?
- Subject: Re: Asynchronously mounting a remote file server?
- From: Jens Alfke <email@hidden>
- Date: Thu, 13 Jun 2013 22:40:00 -0700
On Jun 13, 2013, at 2:17 PM, Rick Mann <email@hidden> 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.
—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