How to make file creation an atomic operation? How to make file creation an atomic operation? python python