in reply to How do I lock a file?
if you
you will truncate the file before you have it locked, this may not be what you want in a production system! Useopen(FILE, ">testing")
before you get the lock and then truncate() if you want to, er, truncate the file once its locked. Or lock a separate semaphore file who's contents are unimportant.open(FILE, ">>testing")
|
|---|