lock: Locking/Unlocking

Description Usage Arguments Details Value Author(s) Examples

Description

Locks a file in exclusive or shared mode.

Usage

1
lock(path, exclusive = TRUE)

Arguments

path

Character. The path.

exclusive

Logical. The lock type, exclusive or shared.

Details

The file is created if it doesn't exist.

Value

Returns an object of type FileLock, which is to be used for the unlock call.

Author(s)

Ivan Popivanov

Examples

1
2
3
4
5
6
7
8
## Not run: 
require(flock)

file.lock = lock("~/file.lock")
# Critical section code goes here
unlock(file.lock)

## End(Not run)


Search within the flock 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.