FileSystemManager.statSync在真机无法使用recursive

小游戏 企业微信 微信支付 小程序 文章 2020-07-30 20:59 578 0 全屏看文

AI助手支持GPT4.0

FileSystemManager.statSync在真机无法使用recursive
框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小游戏 Bug FileSystemManager.statSync 微信安卓客户端 7.0.16 2.11.3

使用FileSystemManager.statSync来读取本地路径的目录时,recursive为false,可以正常读取,为true时,会报错fail permission denied

模拟器上正常,安卓手机上报错。读取的路径不是wxUserData,是自己的代码目录


Framework type problem type API / component name terminal type wechat version basic library version games bug FileSystemManager.statSync Use of wechat Android client 7.0.16 2.11.3 FileSystemManager.statSync To read the directory of the local path, recursive is false and can be read normally. If it is true, an error of fail permission denied will be reported The simulator is normal. Android phone reports an error. The read path is not wxuserdata, but its own code directory

回答:

Forever:

本地路径,而不是代码包路径。小游戏有以下路径,代码包绝对路径、本地临时路径、本地路径和本地缓存路径

羽翼栗子球:就是项目根目录下 fs.statSync("/settings", true);这样
羽翼栗子球:我这样路径不对吗?如果一个项目根目录下的settings文件夹,我路径应该怎么表示呢
Forever:代码包路径===项目目录,文档没有说支持吧
羽翼栗子球:那如果我要返回资源的总量之类的,无法通过readdir或者stat来获取目录下的文件吗?
Forever:这个问题是我们这边的bug,我去反馈一下

-EOF-

AI助手支持GPT4.0