Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

lock

Locking/Unlocking


Description

Locks a file in exclusive or shared mode.

Usage

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

## Not run: 
require(flock)

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

## End(Not run)

flock

Process Synchronization Using File Locks

v0.7
Apache License 2.0
Authors
Ivan Popivanov
Initial release
2016-11-10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.