title: julia one-liner to write a tempfile and get its name?
body: <p>what is the easiest/clearest/simplest/shortest way to A) create a tempfile, B) write a string to it, and C) return the newly created file's name?</p>
  
  <p>This is the best I've got so far:</p>
  
  <pre><code>fname,io = mktemp(); write(io, "&lt;contents&gt;");
  # use fname...
  </code></pre>
  
  <p>Is there some clever, fancy thing I could do with <code>do end</code>? Anyone have a better suggestion? :) Thanks!</p>