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.
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.