Hello I found an interesting article about this topic on stackoverflow. https://stackoverflow.com/questions/17708885/flock-removing-locked-file-without-race-condition Beset regards Florian