tags:

views:

89

answers:

3

How do I tell ruby to create files with the attributes FILE_ATTRIBUTE_TEMPORARY and FILE_FLAG_DELETE_ON_CLOSE?

A: 

I grepped Ruby 1.8.7 source and did not find any mention of those attributes, so I'm thinking that you get to fix it and build from source...

DigitalRoss
+2  A: 

You can call Windows functions using the Ruby win32api library. See these examples. It's painful, but it works.

zetetic
A: 

Probably because of it's Unix roots, Ruby doesn't (yet) allow that. You can probably obtain the result you want with:

require 'tempfile'
Tempfile.new "my_temp_file" do |f|
  #...
end
Marc-André Lafortune