Query: flock
OS: netbsd
Section: 1
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
FLOCK(1) BSD General Commands Manual FLOCK(1)NAMEflock -- Provide locking API for shell scriptsSYNOPSISflock [-dnosvx] [-w timeout] lockfile|lockdir [-c command] | [command ...] flock [-dnsuvx] [-w timeout] lockfdDESCRIPTIONThe flock utility provides flock(2) access to the command line or scripts. The first form locks a file or directory while the command pro- vided is executed. If the file or directory does not exist, then a file is created. The second form can use an arbitrary file descriptor that is provided from a shell script for example: ( flock -s 100 # commands to be executed under the lock ) 100> /path/to/lockfile The following options are available: -c command Pass a command to a the shell. -d, --debug Provide debugging output. -n, --nb, --nonblock Don't block and fail immediately if the lock could not be obtained. -o, --close Close the file before executing the command. This is useful if the child forks and should not be holding the lock. -s, --shared Obtain a shared lock. -u, --unlock Unlock an existing lock. This is available only for a file descriptor. -v, --verbose On error print an explanation of the failure. -w, --wait, --timeout seconds Fail if the lock could not be obtained after seconds. -x, --exclusive Obtain an exclusive lock.EXIT STATUSThe flock utility exits 0 on success, and >0 if an error occurs.SEE ALSOshlock(1), flock(2)HISTORYAn flock utility appeared in NetBSD 6.1.BSDNovember 2, 2012 BSD
Related Man Pages |
---|
flock(1) - centos |
flock(2) - freebsd |
flock(1) - x11r4 |
flock(1) - xfree86 |
flock(1) - posix |