Re: Best way to determine if a directory is a package
Re: Best way to determine if a directory is a package
- Subject: Re: Best way to determine if a directory is a package
- From: Jean-Daniel Dupas <email@hidden>
- Date: Fri, 25 Jun 2010 00:02:58 +0200
Le 24 juin 2010 à 23:24, Ron Aldrich a écrit :
> Hello All,
>
> I've been asked to add the ability to drop a folder onto my application, and scan the folder for acceptable documents.
>
> I'd like to filter the scan such that any file which is contained within a package, or within a hidden folder is skipped.
>
> I'll be using NSDirectoryEnumerator to enumerate the folder.
>
> So, first - Given a file path (or URL, if needed), how do I reliably determine if the path points to a package?
>
> And second, how do I reliably determine if the path points to a hidden item?
>
> Ideally, I'd like to be using the same logic for both of these as Finder is using.
>
> Thanks for your time,
The 10.6 way:
- [NSURL getResourceValue:forKey:error:];
using NSURLIsHiddenKey and NSURLIsPackageKey
The Pre 10.6 way, LSCopyItemInfoForURL and then check info.flags.
-- Jean-Daniel
_______________________________________________
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