How do I create a temporary file in Groovy? -


in java there exists java.io.file.createtempfile function create temporary files. in groovy there doesn't seem exist such functionality, function missing file class. (see: http://groovy.codehaus.org/groovy-jdk/java/io/file.html)

is there sane way create temporary file or file path in groovy anyhow or need create 1 myself (which not easy right if i'm not mistaken)?

thank in advance!

file.createtempfile("temp",".tmp").with {     // include line below if want file automatically deleted when      // jvm exits     // deleteonexit()      write "hello world"     println absolutepath } 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -