Attempts to safely write |data| to a file at |path|.
This operation can be made atomic by specifying the |tmpPath| option. If
specified, then this method ensures that the destination file is not
modified until the data is entirely written to the temporary file, after
which point the |tmpPath| is moved to the specified |path|.
The target file can also be backed up to a |backupFile| before any writes
are performed to prevent data loss in case of corruption.
Returns
Resolves with the number of bytes successfully written to the file,
otherwise rejects with a DOMException.
Attempts to safely write |data| to a file at |path|.
This operation can be made atomic by specifying the |tmpPath| option. If specified, then this method ensures that the destination file is not modified until the data is entirely written to the temporary file, after which point the |tmpPath| is moved to the specified |path|.
The target file can also be backed up to a |backupFile| before any writes are performed to prevent data loss in case of corruption.
Returns
Resolves with the number of bytes successfully written to the file, otherwise rejects with a DOMException.