Adding from RELENG_1_2: safe_write_file() Writes a file out atomically by first writing to a temporary file of the same name but ending with the pid of the current process, them renaming the temporary file over the original.
Adding from RELENG_1_2: safe_write_file() Writes a file out atomically by first writing to a temporary file of the same name but ending with the pid of the current process, them renaming the temporary file over the original.