Previous: , Up: posix fd   [Index]


4.13.13 Locking files

Function: lockf fd cmd len

Interface to the C function lockf(), (*manpages*)lockf. Apply, test or remove a POSIX lock on a section of an open file; if successful return unspecified values, else raise an exception

The file is selected by the file descriptor fd. The action by the signed integer cmd. The file section is from the current position up to len bytes.

cmd must be one of the constants: F_LOCK, F_TLOCK, F_ULOCK, F_TEST.