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
Post a Comment