in reply to Re^4: Why can't some of my modules do log output to a file?
in thread Why can't some of my modules do log output to a file?
Instead of closing the file handle, you could just release the lock.
That's what LanX and I both said.
So, lock, write, unlock will cause 2 flushes.
That's why I wrote "lock-seek-write-flush-unlock" and not "flock-seek-print-flock", because I was referring to the underlying operations.
There is no need to explicitly seek
That is very wrong unless you know for sure that O_APPEND semantics are guaranteed. For example, if the file was opened with '+<' instead of >> or on NFS filesystems, you definitely need the seek or you will corrupt your data.
|
|---|