WriteFile writes content to a destination file, potentially overwriting the
destination file.
It returns an error when
- the file cannot be written;
- the destination file is an existing directory;
- the destination file already exists and overwrite is false