.\" wlock - Tests or sets a file with POSIX-fcntl() write-locks .\" Copyright (c) 1998 Martin Schulze .\" .\" This program is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program; if not, write to the Free Software .\" Foundation, Inc.,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. .\" .TH WLOCK 1 "19 March 1998" "" "System Administration" .SH NAME wlock \- Tests or sets a file with POSIX-fcntl() write-locks .SH SYNOPSIS .B wlock .RB [ " \-s " [ "\-a \fIseconds\fR " ]] .RB [ " \-t" ] .RB [ " \-v" ] .RB [ " \-b \fIbegin\fR " ] .RB [ " \-l \fIlength\fR " ] .I file .br or .br .B wlock .RB [ " \-s " ] .RB [ " \-v" ] .RB [ " \-b \fIbegin\fR " ] .RB [ " \-l \fIlength\fR " ] .IR "file program " "[ " arguments " ]" .SH DESCRIPTION .B This program sets or tests advisory locks conforming to POSIX fcntl() call. You may specify optionaly a program to start it within the lock context. .SH OPTIONS These options are accepted. If a program is provided as argument .B wlock will start it. .TP .B "\-s" Sets the lock. .TP .B "\-t" Test the lock (default). .TP .B "\-v" Verbose output. .TP .BI "\-b " begin The lock starts at byte .RI # begin . .TP .BI "\-l " length The lock will be .I length bytes long. .TP .BI "\-a " seconds The lock is active for .I seconds (default=86400). .PP .SH "RETURN VALUES" .TP .B 0 In test mode this means that the file is locked. In set mode it indicates the succesful creation of the lockfile .TP .B 1 The file is not locked. Only available in testmode. .TP .B 2 Some error has occurred. .SH AUTHOR .B wlock has been written by Ulli Horlacher (framstag@belwue.de>. .SH "SEE ALSO" .BR sendfile (1).