Next File Locking 10

Trap #3: Shutting the Barn Door etc.

Solution 1:

        open F, "+< somefile" or die ...;
        flock F, LOCK_EX or die ...;
        truncate F, 0 or die ...;
        # Now write F
        close F;


Next Copyright © 2003 M. J. Dominus