Changes for locking/unlocking a file