Class: Updater::Util

Inherits:
Object
  • Object
show all
Defined in:
lib/updater/util.rb

Class Method Summary collapse

Class Method Details

.tempioObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/updater/util.rb', line 6

def tempio
  fp = begin
    File.open("#{Dir::tmpdir}/#{rand}",
              File::RDWR|File::CREAT|File::EXCL, 0600)
  rescue Errno::EEXIST
    retry
  end
  File.unlink(fp.path)
  fp.binmode
  fp.sync = true
  fp
end