path: add atomic write