in reply to Race conditions

To achieve the same effect without locking, you can write the HTML to a temp file, then rename the file to the final name.

Replies are listed 'Best First'.
Re^2: Race conditions
by toniax (Scribe) on Nov 16, 2010 at 23:31 UTC
    Hi,
    I was not at all clear with my post . I thought I could use flock on -unless-
    to prevent a race condition. since the code is in between the opening and closing of the
    semaphore file. I can not figure out a different way to check if a file exist and write to it ,so it is not possible
    for a race condition to accrue as it could using unless.

      Actually, this is the post that I can't understand. What do you want your code to do?

        I have to do more reading and research on flock.
        Hopefully I will be able to post a question that makes more
        sense after my research.