Skip to content

FileSystemManager.writeFileSync ​

JS
    FileSystemManager.writeFileSync(
        string filePath,
        string | ArrayBuffer data,
        string encoding)

Write a file

The synchronous version of FileSystemManager.writeFile

Parameters

  • string filePath: Path of the file to append content to

  • string|ArrayBuffer data: Text or binary data to append

  • string encoding: Character encoding used to write the file; see the table below for valid values

Valid values of encoding

ValueDescription
utf8utf-8 character encoding
utf-8utf-8 character encoding
binarybinary

Parameters of the captured exception

  • string error: Returns the error message; see the table below for valid values

Valid values of error:

Error messageDescription
no such file or directoryThe specified filePath does not exist, or is a directory
permission deniedNo write permission for the specified target file path