Lock file implementation