X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/misc/blobdiff_plain/b7ec4e9118fa390ec20408390a06f3c51a035155..ed1b4ef8dff60ba943f553d5faeb049df9b621b7:/locking.1 diff --git a/locking.1 b/locking.1 index 5183790..a9a37aa 100644 --- a/locking.1 +++ b/locking.1 @@ -97,6 +97,21 @@ for days, hours, minutes or seconds, respectively) for the lock to become available, and then give up. This only makes sense with the .B \-\-wait option, so that is turned on automatically. +.PP +It is safe to unlink or atomically replace the lockfile while holding +the lock, though these actions will release the lock immediately. To +safely delete the lockfile, for example, run +.IP +.B "locking lock rm lock" +.PP +Similarly, a file can be updated safely by +.IP +.nf +.ft B +locking file sh -c \e +\h'8m'"update-file file >file.new && mv file.new file" +.fi +.ft R .SH "BUGS" The .B locking