Re: Directory enumeration gives wrong file type for aliases
Re: Directory enumeration gives wrong file type for aliases
- Subject: Re: Directory enumeration gives wrong file type for aliases
- From: Jens Alfke <email@hidden>
- Date: Sat, 08 Oct 2016 11:45:20 -0700
> On Oct 7, 2016, at 5:03 PM, Gabriel Zachmann <email@hidden> wrote:
>
> One thing that surprised me a little, in light of the fact that aliases are completely different from symlinks,
> is that
> [url getResourceValue: &isAlias forKey: NSURLIsAliasFileKey error: nil]
> yields true for both aliases and symlinks.
> Similarly, the method URLByResolvingAliasFileAtURL: seems to resolve both aliases and symlinks just fine.
It’s just trying to hide the difference between aliases and symlinks, since to a reader they’re equivalent (a file that acts as a pointer to another file.) Similar to how the Finder calls both of them ‘aliases’.
(If you’re curious about why both exist, it’s because aliases date back to System 7 in 1991, ten years before Apple adopted a Unix-based OS. They’re still around because they offer features that symlinks don’t, as well as for backward compatibility. Backward compatibility is also why aliases aren’t traversed semi-automatically by the filesystem the way symlinks are.)
—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