OptionalappendAdd to the end of the file instead of replacing its content.
OptionalatomicWrite a temporary file next to the target, flush it to disk, then replace the target with one rename: readers see the old content or the new content, never a partly written file. If the replacement fails, for example because another program has the target open, the call fails and the target keeps its old content. The temporary file is named .~<process id>-<sequence>.tmp, and its path has to fit in 259 characters as well. Cannot be combined with append; passing both fails with INVALID_PARAMS.
OptionalcontentWhat to write. With encoding: "binary" a value starting with base64: is decoded and the bytes are written: characters outside the Base64 alphabet are skipped and decoding stops at the first =. Any other value, plain Base64 or a Data URL included, is written as it is. An empty string empties the file unless append is set.
OptionalencodingOnly exactly binary changes anything: the file is written in binary mode and a content starting with base64: is decoded. Any other value writes text.
File to write; missing parent directories are created.
Parameters for
file.write. Write text, or bytes decoded from Base64, to a file. Missing parent directories are created first.