in reply to Re^4: File locking
in thread File locking
In other words, file locks are normally* cooperative, if some program doesn't try to lock a file, it can bypass all locks.
In other words again, my sample code is correct; you open the file for append (or you can use some other non-destructive open) and lock after that (but before writing).
If this doesn't help, please show some code or explain what you're trying to do, because right now it just looks like you don't know what file locks do and don't do on UNIX.
* Update: some unix systems also provide mandatory locks. I'm ignoring those since a) they're not portable and b) I don't like mandatory locks.
|
|---|