• 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: Recursive file remove
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recursive file remove


  • Subject: Re: Recursive file remove
  • From: Charles Srstka <email@hidden>
  • Date: Sat, 14 Aug 2010 22:37:34 -0500

On Aug 14, 2010, at 10:14 PM, mark wrote:

>> As noted, your choices are either NSFileManager methods of BSD/POSIX functions.  I would tend to start with the latter because, at the end of the week, NSFileManager might not have the configurability you need to handle the nitty-gritty like system "dot" or "dot dot" files, (not) following symbolic links, etc. etc.  But it may be just a personal preference.  NSFileManager has not always been my friend.
> <snip>
>
> What's wrong with FSDeleteObjec()? (Core Services File Manager).
> You need to do a lot of recursive stuff using to empty directories bottom up.

FSDeleteObject is not recursive and requires you to iterate through the entire subtree just like unlink, requires you to get an FSRef (which you’ll usually not be working with in a Cocoa app), and fails if Spotlight happens to be indexing a file or an anti-virus app is scanning it (as per Technical Q&A QA1497).

However, this is not the most cumbersome possible solution, and therefore not good enough. Obviously what you *really* want to do is dismount the volume, open the character device, parse the HFS+ volume structures, and manually delete the items out of the catalog file.

Charles_______________________________________________

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: 
 >Recursive file remove (From: Tom Jones <email@hidden>)
 >Re: Recursive file remove (From: Don Quixote de la Mancha <email@hidden>)
 >Re: Recursive file remove (From: Jerry Krinock <email@hidden>)
 >Re: Recursive file remove (From: mark <email@hidden>)

  • Prev by Date: Creating a Big and Resizable Question Mark in the Middle of a View
  • Next by Date: Planning iOS Training in Australia - Your help required!
  • Previous by thread: Re: Recursive file remove
  • Next by thread: Re: Recursive file remove
  • Index(es):
    • Date
    • Thread