I'm new to C and Linux and want to know what does it mean to lock file in linux using C functions lockf, flock and fcntl? since I'm comming from windows background where locked files can never be altered by any other process but for linux when ever I lock file for my process, the file simply can be modified by any other process and even deleted by desktop file browser!
I've used 'lslock' program and my files are all locked using Type/POSIX MODE/WRITE START/0 END/0 PATH/my/file/path
Is locking file in linux has different meaning of locking file on windows where on windows locked file is impossible to be altered by any other process.
Also, I read on the internet that NFS 'linux' dosn't provide lock on file unless a range of bytes is dfined and how to do that?
I've ran through examples of this article https://gavv.github.io/blog/file-locks/