File locking

Create a temp file for file locking
The two lines above appear to be indented 12 spaces, I believe it should only be 8.