If one or more processes access the same file, how do I handle synchronisation? Is there a way I can lock a file when I am reading it?