-
Notifications
You must be signed in to change notification settings - Fork 207
File
xu_whale edited this page Sep 7, 2020
·
10 revisions
File工具类
exist(string path)
文件是否存在
rootPath()
获取客户端根目录
isDir(string path)
是否是文件夹
isFile(string path)
是否是文件
syncReadString(string path)
从文件中同步读取string
syncWriteFile(string path, string content)
同步写文件
syncWriteMap(string path, Map map)
将map内容同步写入文件
syncWriteArray(string path, Array b)
将array内容同步写入文件
syncUnzipFile(string path, string b)
同步解压文件
asyncUnzipFile(string path, string b, function callback)
异步解压文件
asyncWriteArray(string path, Array content, function asyncWriteArrayCallback)
异步写Array到文件中
asyncWriteMap(string path, Map content, function asyncWriteMapCallback)
异步写Map到文件中
asyncWriteFile(string path, string content, function asyncWriteFileCallback)
异步写string到文件中
asyncReadFile(<#type#> path, <#type#> asyncReadFileCallback)
异步读取文件
asyncReadArrayFile(string path, function asyncReadArrayFileCallback)
异步读取数组文件内容
getStorageDir() ❌
获取MLN存储主目录
asyncCreateFile(string path, function asyncCreateFileCallback)
创建文件
asyncCreateDirs(string path, function asyncCreateDirsCallback)
创建文件夹
asyncDelete(string path, function asyncDeleteCallback)
删除文件/文件夹
asyncMoveFile(string srcPath, string dstPath, function asyncMoveFileCallback)
移动文件/文件夹
asyncCopyFile(string srcPath, string dstPath, function asyncCopyFileCallback)
拷贝文件/文件夹
asyncGetFileList(string srcPath, boolean recursive, function asyncGetFileListCallback)
获取指定文件夹下所有文件/文件夹
getFileInfo(string filePath)
获取文件属性
syncMd5File(string filePath)
同步获取文件MD5值
asyncMd5File(string filePath, function asyncMd5FileCallback)
异步获取文件MD5值