Giter Site home page Giter Site logo

Comments (3)

andresilva avatar andresilva commented on May 25, 2024

I think the removal of temporary files should be a best effort approach, i.e. there's not much that can be done if the running application is killed. That said, I'm not sure File.deleteOnExit will work in either of the cases you described. But at least for the first one we can get around it by adding a shutdown hook to do the clean up (http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Runtime.html#addShutdownHook(java.lang.Thread)).
I don't have access to a Windows computer where I can test this.

from lz4-java.

jpountz avatar jpountz commented on May 25, 2024

I tend to agree to the best effort approach. Looking at openjdk sources, it looks like File.deleteOnExit adds a shutdown hook (http://hg.openjdk.java.net/icedtea/jdk7/jdk/file/10672183380a/src/share/classes/java/io/DeleteOnExitHook.java, http://hg.openjdk.java.net/icedtea/jdk7/jdk/file/10672183380a/src/share/classes/java/io/File.java) so both approaches should work the same way?

from lz4-java.

jpountz avatar jpountz commented on May 25, 2024

I added comment to LZ4Factory to say that on some OS, lz4-java may leave files in the temporary directory.

from lz4-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.