X-Git-Url: https://git.distorted.org.uk/~mdw/misc/blobdiff_plain/71d8432e96caa48f761666b6c07f5519d98d04a4..e3c481ba08bda2536aa76f9e3a6be2146e2b135d:/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