Learn R Programming

flock (version 0.7)

is.locked: Locking/Unlocking

Description

Checks whether a lock has been obtained.

Usage

is.locked(file.lock)

Arguments

file.lock
The lock as an object of type FileLock.

Examples

Run this code
## Not run: 
# require(flock)
# 
# file.lock = lock("~/file.lock")
# # Critical section code goes between here and the unlock call
# if(is.locked(file.lock)) {
#    print("Got the lock!")
# }
# unlock(file.lock)
# ## End(Not run)

Run the code above in your browser using DataLab