add lock to prevent clobering files, unless intentional