class method
Gem.open_file_with_lock
open_file_with_lock(path, &block)
lib/rubygems.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/rubygems.rb, line 856
def self.open_file_with_lock(path, &block)
file_lock = "#{path}.lock"
open_file_with_flock(file_lock, &block)
ensure
require "fileutils"
FileUtils.rm_f file_lock
end
Open a file with given flags, and protect access with a file lock