Reputation: 24134
I'm creating a Tempfile like this
Tempfile.new("myfile.txt")
This creates a file like this
TempDir/myfile.txt20120210-1696-yd53si
but I need it to create it like this
TempDir/20120210-1696-yd53si/myfile.txt
How to do that?
Upvotes: 0
Views: 173
Reputation: 80105
Looks like you want a tmpdir, not a tmpfile.
require 'tmpdir'
puts Dir.mktmpdir('') #the empty string means : no prefix
#=>"/tmp/20120210-9462-kzrkxx"
Upvotes: 1