FileSystemManager.readFile

2020-02-14 13:44 更新

FileSystemManager.readFile(Object object)

讀取本地文件內(nèi)容


輸入

繼承標(biāo)準(zhǔn)對(duì)象輸入,擴(kuò)展屬性描述:

屬性類型默認(rèn)值是否必填說明
filePathstring要讀取的文件的路徑
encodingstring指定讀取文件的字符編碼,如果不傳 encoding,則以 ArrayBuffer 格式讀取文件的二進(jìn)制內(nèi)容
說明
ascii
base64
binary
hex
ucs2/ucs-2/utf16le/utf-16le以小端序讀取
utf-8/utf8
latin1


輸出

success 回調(diào)函數(shù)參數(shù) Object

屬性類型說明
datastring/ArrayBuffer文件內(nèi)容

fail 回調(diào)函數(shù)參數(shù) Object

屬性類型說明支持版本
errMsgstring錯(cuò)誤信息
說明
fail no such file or directory, open ${filePath}指定的 filePath 所在目錄不存在
fail permission denied, open ${dirPath}指定的 filePath 路徑?jīng)]有讀權(quán)限


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)