未验证 提交 39b0b201 编写于 作者: 潘钦旭 提交者: Gitee

Signed-off-by: panqinxu <panqinxu1@huawei.com>

上级 ec0141a7
......@@ -17,6 +17,19 @@ import fileio from '@ohos.fileio';
使用该功能模块对文件/目录进行操作前,需要先获取其应用沙箱路径,获取方式及其接口用法请参考:
Stage模型
```js
import Ability from '@ohos.application.Ability'
class MainAbility extends Ability {
onWindowStageCreate(windowStage) {
let context = this.context;
let path = context.filesDir;
}
}
```
Stage模型context的具体获取方法参见[Stage模型](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-ability-context.md#abilitycontext)
FA模型
```js
import featureAbility from '@ohos.ability.featureAbility';
let context = featureAbility.getContext();
......@@ -25,7 +38,7 @@ import fileio from '@ohos.fileio';
path = data;
})
```
FA模型context的具体获取方法参见[FA模型](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-Context.md#context%E6%A8%A1%E5%9D%97)
## fileio.stat
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册