Atomically save data to a file (if the file doesn't exist, or its contents differs).
See Implementation
Atomically save data to a file (if the file doesn't exist, or its contents differs).