Feature #568

Decide whether to implement File.deleteOnExit

Added by abeluck almost 5 years ago. Updated almost 4 years ago.

Status:NewStart date:01/25/2013
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-
Component:

Description

deleteOnExit: Schedules this file to be automatically deleted when the VM terminates normally.

Should we implement this?

My initial reaction is no, given this:

     Note that on Android, the application lifecycle does not include VM termination,
     so calling this method will not ensure that files are deleted. Instead, you should
     use the most appropriate out of:
     * Use a {@code finally} clause to manually invoke {@link #delete}.
     * Maintain your own set of files to delete, and process it at an appropriate point
        in your application's lifecycle.
     * Use the Unix trick of deleting the file as soon as all readers and writers have
       opened it. No new readers/writers will be able to access the file, but all existing
       ones will still have access until the last one closes the file.

History

#1 Updated by hans almost 4 years ago

  • Target version deleted (61)

Also available in: Atom PDF