def write_file(path, data)
      File.open(path, "w+") do |file|
        file.flock(File::LOCK_EX)
        file.write(data)
        file.flock(File::LOCK_UN)
      end

      true
    end
def write_file(path, data)
      File.open(path, "w+") do |file|
        file.flock(File::LOCK_EX)
        file.write(data)
        file.flock(File::LOCK_UN)
      end

      true
    end
Writes file content. Access to the file
 uses file locking.