Software
Placeholder

filelock

Cross platform file locking in R

R

The filelock package provides portable file locking for R across Windows and Unix-like systems, using platform-specific mechanisms (LockFile on Windows, fcntl on Unix). It enables processes to place exclusive or shared locks on files to coordinate access and prevent conflicts.

The package implements advisory locks (Unix) or mandatory locks (Windows) that are automatically released when a process terminates or when the lock object is garbage collected. It supports configurable timeout intervals for lock acquisition, including blocking indefinitely until a lock becomes available. The package is designed to work with dedicated lock files rather than locking actual data files directly, which avoids undefined behavior when reading or writing locked files.

Contributors