Rewrite your question without txtspk and I'll think about it. Add a comment. Active Oldest Votes. Add the following code after you have done your operations with the file : buffout. Improve this answer. Mnementh Mnementh Was about to write the same thing.
As a rule, deleteOnExit is rather unreliable. I would do the above, but also check the return value from temp. As Mike said, I would not rely on deleteOnExit. Additionally the temporary file is kept until the end of the program-execution, even if no longer needed. On a server-application that can be a long time. So explicitly deleting the file is preferable. Can you delete the file from Windows Explorer assuming you're using Windows?
I don't think I'm wrong about writing the files to disk iff there's not much memory - it's just that on Windows it's an accessible file and on tmpfs it's in the swap space. Show 5 more comments. Ravindra Ravindra 2 2 silver badges 8 8 bronze badges. Whilst this is true from the question, the solution to this could be generic because tmpfs does exactly the same job in Linux.
Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually.
Visit chat. Related Java - How to create a Jar file in an Ant target. Mac Finder: How to create a new folder from keyboard. Creating and populating a Java ArrayList Java 9 and newer. Scala 3 opaque types: How to create meaningful type names.
Scala 3 modules: How to build modular systems. Docker cheat sheet cheatsheet. The ideal of warriorship is Different Ways to fix "Execution failed for task ':app:clean'. Unable to delete file" error in Android Studio. Article Contributed By :. Easy Normal Medium Hard Expert. Writing code in comment? Please use ide. Load Comments.
0コメント