flock (FH, LOCK_EX); # acquire exclusive lock seek (FH, 1, 0); # resynchronise the file buffer