fp = io.tmpfile() -- do some file operations fp:close()