Learn R Programming

caroline (version 0.3-6)

getFileLock: Check and Set a Lock File

Description

A function to set a lock file (a file with the same name + 'LOCK') to indicate exclusive write access of that file by a process. Used in conjunction with rmLockFile to lock a file up for one processor at a time in a multiprocessor environment.

Usage

getFileLock(filepath, wait.time=.01, id)

Arguments

filepath
The path to the file you wish to lock.
wait.time
The waiting time (in seconds) between checks for an existing processor's exclusive write lock on 'filepath'.
id
unique process identifier

See Also

rmFileLock