File locking

Create a temp file for file locking
Indenting is off here too.