Yes, and combined with the technique in the link Kevin provided, it's clean if something goes wrong, java/the os will take care of deleting the temp file for you :
// Create temp file. File temp = File.createTempFile(*"pattern"*, *".suffix"*); // Delete temp file when program exits. temp.deleteOnExit(); -- Laurent 2009/2/15 James Reeves <weavejes...@googlemail.com> > > On Feb 15, 12:42 pm, Laurent PETIT <laurent.pe...@gmail.com> wrote: > > Well, so indeed, the temporary file solution seems a good one, then. > > The consensus seems to be to use a temporary file, then. I had thought > there might be a flashy cutting-edge way of handling this sort of IO, > but I guess sometimes the best solutions are the simplest. As Mark H. > mentioned, it also allows you to 'roll back' file writes that went > wrong. > > - James > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---