News for hackers. Stuff that matters.
Re:File Locks on Linux by jmclnx on Wednesday May 10, 2023 @10:01AM (#35887500)
There is a process I have that uses flock(1) with an exclusive read lock. The intent was other processes can read the data but not allow to change it.

It "works", but I noticed many newer utilities no longer checks for these locks. The original vi and nvi checks, so the file is opened read-only. But vim and surprisingly emacs do not check. That means people can change that file while the process is executing using vim/emacs.

Re:File Locks on Linux by remram on Wednesday May 10, 2023 @07:31PM (#35895039)
What's an "exclusive read lock"?
Re:File Locks on Linux by jmclnx on Friday May 19, 2023 @02:36PM (#36005360)
if you are reading a file amd put a read lock on it, vi(1) will refuse to write to it, but can read it.