# FileSystemManager.appendFile(Object object)

Start from base library version 2.1.0. Please remaining backward compatible.

Appends content at the end of a file.

# Parameters

# Object object

Attribute Type Default Required Description
filePath string Yes Path to the file to which you want to append content
data string/ArrayBuffer Yes Text or binary data to be appended
encoding string utf8 No Specifies the character encoding of the written file
success function No The callback function for a successful API call
fail function No Callback function for failed API call
complete function No Callback function used when API call completed (always executed whether call succeeds or fails)

Valid values of object.encoding

Value Description Minimum Version
ascii
base64
binary
hex
ucs2 Read in little endian
ucs-2 Read in little endian
utf16le Read in little endian
utf-16le Read in little endian
utf-8
utf8
latin1

# object.fail callback function

# Parameters
# Object res
Property Type Description
errMsg string Error message

Valid values of res.errMsg

Value Description Minimum Version
fail no such file or directory, open ${filePath} File with the specified filePath does not exist
fail illegal operation on a directory, open "${filePath}" The specified filePath is an existing directory
fail permission denied, open ${dirPath} No write permission on the specified filePath
fail sdcard not mounted The specified filePath is an existing directory
点击咨询小助手