如何告诉ruby创建属性为FILE_ATTRIBUTE_TEMPORARY
和FILE_FLAG_DELETE_ON_CLOSE
?
You can call Windows functions using the Ruby win32api library. See these examples . It's painful, but it works.
我使用了Ruby 1.8.7的源代码,却没有提到这些属性,因此我认为您可以修复它并从源代码进行构建...
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.