欢迎访问!

Office学习网

您现在的位置是:主页 > 网络技术

网络技术

FileSystemManager.readFileSync · 小游戏

发布时间:2026-07-04网络技术评论
微信小游戏文档

string|ArrayBuffer FileSystemManager.readFileSync(string filePath, string encoding) FileSystemManager.readFile 的同步版本 参数string filePath 要读取的文件的路径 string encoding 指定读取文件的字符编码,则以 ArrayBuffer 格式读取文件的二进制内容 encoding 的合法值 值说明最低版本 ascii base64 binary hex ucs2 以小端序读取 ucs-2 以小端序读取 utf16le 以小端序读取 utf-16le 以小端序读取 utf-8 utf8 latin1 返回值string|ArrayBuffer data 文件内容 错误错误码错误信息说明 fail no such file or directory,如果不传 encoding, open ${filePath} 指定的 filePath 所在目录不存在 fail permission denied, open ${dirPath} 指定的 filePath 路径没有读权限 ,。

广告位

热心评论

评论列表