makelock: Make and remove (NFS safe) lock files

Description Usage Arguments Value Author(s) Examples

Description

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.

Usage

1
2
3
makelock(lockfile, lockmsg, CreateDirectories = TRUE)

removelock(lockfile)

Arguments

lockfile

Path to lockfile

lockmsg

Character vector with message to be written to lockfile

CreateDirectories

Recursively create directories implied by lockfile path

Value

logical indicating success

Author(s)

jefferis

Examples

1
2
3


Search within the nat.utils package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.