Deletes file
, recursively if it is a directory.
Recursively deletes empty directories, stopping at the first non-empty dir.
Performs a safe write to the file.
Performs a safe write to the file. Returns true if the file was completely written, false otherwise