3 ms·
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 "wor
by jmclnx 4y ago
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.