Low-level flock object

Usage

flock(filename, method = "fcntl")

Arguments

filename
Name of file to lock. NULL is a fake lock; acquire always succeeds.
method
Method to use

Description

Low-level flock object. Use this if you need more flexibility than with_flock, but understand that if you get it wrong you can cause deadlocks.

Methods

acquire
Attempt to acquire a lock on the file. For details on arguments see the main argument section above.

Usage: acquire(delay = 0.01, max_delay = 0.1, timeout = Inf, error = TRUE, verbose = FALSE)

Arguments:

  • delay: Initial delay

  • max_delay: Maximum delay between attempts

  • timeout: Maximum time to wait

  • error: Throw an error on failure?

  • verbose: Print information while attempting to acquire lock?

release
Release the lock.

Usage: release()