Platform dependent file-locking

MS Windows and Linux handle file locking differently. This article describes both approaches in detail. To summarise though, when you open a file for reading, under windows it prevents others from deleting it or writing to it, however under Linux it does not.

I fell foul of this while trying to run some Java based unit tests that worked perfectly well under Linux but started throwing errors on windows.