in reply to File Locking in CGI programs
Don't explicitly unlock the file before closing it. In earlier perls (and I believe 5.6.0 is early enough) buffers were not flushed before locking/unlocking which could cause some data loss problems. Newer perls will flush before either a lock or an unlock.
Oh, and closing the file will automatically unlock it and flush it, but check the return value of close to be sure that it succeeded.
|
|---|