• 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: NSFileManager - getting list of "safe" files/folders
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSFileManager - getting list of "safe" files/folders


  • Subject: Re: NSFileManager - getting list of "safe" files/folders
  • From: Chris Parker <email@hidden>
  • Date: Mon, 20 Jun 2005 22:13:40 -0700


On Jun 20, 2005, at 7:33 PM, Duncan Campbell wrote:

If I use something like:

 NSFileManager *fileManager = [NSFileManager defaultManager];
  NSArray *array = [fileManager directoryContentsAtPath:fullPath]

I can get an array of files/folders from any path.

If I do this with "/", I get lots of files & folders that I perhaps "shouldn't" see - i.e. terminal would list them, but Finder doesn't (folders like "automount" and "cores" and files like "mach.sym" and "mach_kernel"   ).

Is there a way for me to filter out these folders to replicate the list that Finder gives me?

Cheers for any help.

Nothing's built in directly to NSFileManager - I have an enhancement request for this kind of thing. You could iterate over the directory and check to see if the item is hidden - LaunchServices has direct API for that.

LSCopyItemInfoForURL and the kLSItemInfoIsInvisible bit are the interesting ones.

.chris

-- 
Chris Parker
Cocoa Frameworks
Apple Computer, Inc.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >NSFileManager - getting list of "safe" files/folders (From: Duncan Campbell <email@hidden>)

  • Prev by Date: Re: Loading an RSS (feed://) URL
  • Next by Date: Core Data, Bindings, and default relationships
  • Previous by thread: Re: NSFileManager - getting list of "safe" files/folders [update]
  • Next by thread: Loading an RSS (feed://) URL
  • Index(es):
    • Date
    • Thread