Some work on allowing a file to be locked/unlocked (#256).