Method: Puppet::FileSystem.exclusive_open
- Defined in:
- lib/puppet/file_system.rb
.exclusive_open(path, mode, options = 'r', timeout = 300) { ... } ⇒ Void
Allows exclusive updates to a file to be made by excluding concurrent access using flock. This means that if the file is on a filesystem that does not support flock, this method will provide no protection.
While polling to acquire the lock the process will wait ever increasing amounts of time in order to prevent multiple processes from wasting resources.
122 123 124 |
# File 'lib/puppet/file_system.rb', line 122 def self.exclusive_open(path, mode, = 'r', timeout = 300, &block) @impl.exclusive_open(assert_path(path), mode, , timeout, &block) end |