• 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: Deleting 20000 files in applicationWillTerminate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Deleting 20000 files in applicationWillTerminate


  • Subject: Re: Deleting 20000 files in applicationWillTerminate
  • From: Roland King <email@hidden>
  • Date: Sat, 16 Nov 2013 08:37:46 +0800

On 16 Nov, 2013, at 8:18 am, Jens Alfke <email@hidden> wrote:

>
>
> As for the deletion, I don’t know how long deleting 20,000 files will take; you’d need to experiment. The OS only gives your process a limited amount of time to respond to the enter-background (or terminate) notification before killing the process, but I don’t know exactly how long that is.
>

If you put all the files in a subdirectory and delete the subdirectory, I've found that to be pretty quick. You can also set up a background task which gets a reasonable amount of time to complete, plenty enough to delete files.

Don't forget, your app could just be killed at any point during this, so when you restart, check your flag to see if the user asked for deltes, if it was set then make sure the files were actually deleted, or delete them at that point.


_______________________________________________

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: Deleting 20000 files in applicationWillTerminate
      • From: Jens Alfke <email@hidden>
References: 
 >Deleting 20000 files in applicationWillTerminate (From: Devarshi Kulshreshtha <email@hidden>)
 >Re: Deleting 20000 files in applicationWillTerminate (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Identifying complete size of file when transfer is in progress
  • Next by Date: Re: Identifying complete size of file when transfer is in progress
  • Previous by thread: Re: Deleting 20000 files in applicationWillTerminate
  • Next by thread: Re: Deleting 20000 files in applicationWillTerminate
  • Index(es):
    • Date
    • Thread