8193072: File.delete() should remove its path from DeleteOnExitHook.files

Brian Burkhalter brian.burkhalter at oracle.com
Tue Jul 9 15:31:08 UTC 2019


Hi Roger,

> On Jul 9, 2019, at 8:25 AM, Roger Riggs <Roger.Riggs at oracle.com> wrote:
> 
> The interesting part will be writing/updating the specification to make it clear what happens and under what conditions.
> How often are File instances re-used vs creating new ones.
> And any interactions with other APIs that create or delete files with the same name.  (file channels, zip, etc…)

These interactions also occurred to me. They would be impossible to account for.

> Since deleteOnExit() is an deliberate act, perhaps there should be a corresponding withdrawDeleteOnExit() that reverses it so that it is intentional and not a side-effect of other File methods.

I think this is a better idea. Perhaps “cancelDeleteOnExit()”.

Thanks,

Brian


More information about the core-libs-dev mailing list