Make and remove (NFS safe) lock files
Creates a lock file on disk containing a message that should identify the current R session. Will return FALSE is someone else has already made a lockfile. In order to avoid race conditions typical on NFS mounted drives makelock appends a unique message to the lock file and then reads the file back in. Only if the unique message is the first line in the file will makelock return TRUE.
removelock displays a warning and returns false if lockfile cannot
be removed. No error message is given if the file does not exist.
1 2 3
Path to lockfile
Character vector with message to be written to lockfile
Recursively create directories implied by lockfile path
logical indicating success
1 2 3
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.