mktemp/mkstemp

A

Andrew Walrond

Is this functionality available somewhere? I can't find it...

TIA

Andrew Walrond
 
M

mark sparshatt

Andrew said:
Is this functionality available somewhere? I can't find it...

TIA

The Tempfile class should do what you want

(taken from the Pickaxe II)

require "tempfile"

tf = TempFile.new("afile")
tf.path #=> "/tmp/afile28519.0"
tf.puts("Cosi Fan Tutte")
tf.close

HTH
 
A

Andrew Walrond

The Tempfile class should do what you want

I'd looked at that, but the file gets deleted when the Tempfile object is
finalised. I want the file to stick around after my ruby script exits.

Andrew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,170
Messages
2,570,925
Members
47,468
Latest member
Fannie44U3

Latest Threads

Top