• 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
Recursive search for files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Recursive search for files


  • Subject: Recursive search for files
  • From: James Merkel <email@hidden>
  • Date: Sun, 22 May 2011 20:00:30 -0700

I would like to add a capability to an application to search directories and sub-directories eventually opening all image files (basically using NSDirectoryEnumerator).
Obviously, I can't allow the user to start at say the volume level and do the search. However as far as I can tell, there is nothing in NSOpenPanel for example that prevents the user from starting there. I was trying to come up with a way to prevent the user from starting at the wrong place. (Putting up an Alert that says you can't start there). There's a method in the NSFileManager class called isDeletableFileAtPath. I am thinking that all of those volumes and higher level directories that I want to avoid are not deletable. Therefore I could use this as a filter. The only other approach might be to limit the search to a certain depth (maybe 10 or 20 directories). However that seems kind of mickey-mouse. Should I be looking at the lower level File Manager Reference for some help here?


Has anyone come up with an approach for this?

Thanks,

Jim Merkel
_______________________________________________

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


  • Follow-Ups:
    • Re: Recursive search for files
      • From: Marcelo Alves <email@hidden>
  • Prev by Date: Re: NSCursor - ignore previous (was incomplete)
  • Next by Date: Using WebKit for UI instead of Cocoa in cross-platform app
  • Previous by thread: Re: NSCursor - ignore previous (was incomplete)
  • Next by thread: Re: Recursive search for files
  • Index(es):
    • Date
    • Thread