Method: Roby::Application.log_dir_locked?

Defined in:
lib/roby/app.rb

.log_dir_locked?(path) ⇒ Boolean

Returns:

  • (Boolean)


1070
1071
1072
1073
1074
1075
1076
1077
# File 'lib/roby/app.rb', line 1070

def self.log_dir_locked?(path)
    lock_file_path = File.join(path, LOCK_FILE_EXT)
    return true unless File.exist?(lock_file_path)

    File.open(lock_file_path, "r") do |file|
        !file.flock(File::LOCK_SH | File::LOCK_NB)
    end
end