f-lock

The purpose of this branch is to introduce file-level locking to file operations.