[NTLUG:Discuss] File Locking
Chris Cox
cjcox at acm.org
Thu Apr 12 23:12:26 CDT 2007
Dennis Rice wrote:
> A co-worker would like to set up a file as being locked when a user
> opens it, so that others can not write to the file. I am not aware of
> any permission / attribute that can do this. Anyone have an idea or
> suggestion? Appreciate.
Though I don't recommend it... you can open a file with an exclusive
lock on it (an OS wide lock). However, if you forget to unlock, it
will cause things like your backups to hang since the file is forever
locked.
man flock
(you may only have the function call... openSUSE has flock(1))
More information about the Discuss
mailing list