admin@glassfish.java.net

deleteOnExit related ...

From: Kedar Mhaswade <Kedar.Mhaswade_at_Sun.COM>
Date: Thu, 23 Aug 2007 02:02:53 -0700

Please see the attached ...

attached mail follows:



km105526,

The forum "Java SE", which you have flagged for email nofication, was updated on Aug 23, 2007 1:46:18 AM by alanb.

alanb posted the following message:
--------------------------------------------------------------
Mark - I realize this is slightly off topic from your original post but there has been a number of attempts to resolve the deleteOnExit issues on Windows. The main issue, as you probably know, is that the java.io.classes have always (since jdk1.0) opened files without specifying the delete sharing option. It would be great, and trivial, to fix this but we always need to be careful about changing something that applications may be depending on. To avoid changing long-standing behavior, one of the prototype fixes involved a special shutdown hook that closed open streams before the deleteOnExit mechanism was invoked. Its main side effect was that threads accessing those files during the shutdown would have the files closed (leading to spurious IOExceptions). In the new file system API we of course specify the right sharing options so this problem does not happen. The second issue is when a file has a mapping in memory. Windows does not allow files with a mapping to be deleted. One of the attempts to workaround this involved a special shutdown hook that would unmap before the delete but this leads to potentially nasty problems with threads that might be accessing the mapped region at the time of the shutdown. Anyway, I just mention all this so that you know that these problems haven't been ignored - they are just awkward problems.

A bit closer to your original post is that you'll see that the deleteOnExit method has recently had its spec clarified to specify the ordering.
--------------------------------------------------------------

To respond to this post:

<http://forums.java.net/jive/thread.jspa?messageID=232255>--end--