# FileSystemManager.rmdirSync=
删除本地目录。(同步调用)
# 支持说明
应用能力 | Android | iOS | PC | 预览效果 |
---|---|---|---|---|
小程序 | 3.12.0 | 3.11.0 | 3.10.0 | 扫码预览 用BoosHi扫码或PC端点击 |
网页应用 | 待开发 | 待开发 | 待开发 | 待补充 |
# 输入
名称 | 数据类型 | 必填 | 默认值 | 描述 |
---|---|---|---|---|
dirPath | string | 是 | 本地目录路径 | |
recursive | boolean | 否 | false | 是否需要递归删除指定的目录 |
# 输出
继承标准对象输出,无扩展属性
# 代码示例
const fileSystemManager = bz.getFileSystemManager();
// 必须以 "bzfile://user" 开头
const exmaplePath = "bzfile://user/example-dir";
const res = fileSystemManager.mkdirSync(examplePath, true);
if (!res.errCode) {
console.log("调用成功");
} else {
console.log("调用失败", res.errMsg);
}
const data = fileSystemManager.rmdirSync(examplePath, true);
if (!data.errCode) {
console.log("调用成功");
} else {
console.log("调用失败", data.errMsg);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17