Lock file, instead of lock dir.

Hello! Milan. here genzouw.

Lock file, instead of lock dir.
And unit test code add.