• 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: Best way to determine if a directory is a package
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Best way to determine if a directory is a package (From: Ron Aldrich <email@hidden>)

  • Prev by Date: Re: Compile Error: undeclared (first use in this function) --> While Init'ing an Object
  • Next by Date: NSPanel and NSWindowController
  • Previous by thread: Re: Best way to determine if a directory is a package
  • Next by thread: Re: Best way to determine if a directory is a package
  • Index(es):
    • Date
    • Thread