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

NSFileManager - getting list of "safe" files/folders [update]


  • Subject: NSFileManager - getting list of "safe" files/folders [update]
  • From: Duncan Campbell <email@hidden>
  • Date: Tue, 21 Jun 2005 14:36:59 +1000

Hi folks - sorry I didn't search the forums first, and I know this has been asked before but I cannot find a *complete* solution.

I found some good sample code in this posting:

http://www.cocoabuilder.com/archive/message/2003/11/13/1214

the general consensus seems to be:

* Ignore files beginning with "."
* Ignore files in /.hidden
* Ignore files who's HFS "invisible" flag is set
* Remove some other "special" folders (like "/Network") - does anyone know how to do this?

However, even following all of the above I am still getting too many files!

If I follow the above techniques, and i look at my "/" directory, I still get the following "bad" items:

/etc <dir>
/mach.sym
/mach.sym (this second one is a sym-link to the first) 
/tmo
/var


Any ideas?




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.

D.






Duncan Campbell
=====================
http://www.duncanandsarah.com


 _______________________________________________
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

  • Follow-Ups:
    • Re: NSFileManager - getting list of "safe" files/folders [update]
      • From: Prachi Gauriar <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: Re: Loading an RSS (feed://) URL
  • Previous by thread: NSFileManager - getting list of "safe" files/folders
  • Next by thread: Re: NSFileManager - getting list of "safe" files/folders [update]
  • Index(es):
    • Date
    • Thread