提交 98063617 编写于 作者: 1 18721213663

bugfix fs feature on 3.2r

Signed-off-by: N18721213663 <zhuhongtao12@huawei.com>
上级 c9875e60
...@@ -2573,7 +2573,7 @@ close(callback: AsyncCallback&lt;void&gt;): void ...@@ -2573,7 +2573,7 @@ close(callback: AsyncCallback&lt;void&gt;): void
if (err) { if (err) {
console.info("close stream failed with error message: " + err.message + ", error code: " + err.code); console.info("close stream failed with error message: " + err.message + ", error code: " + err.code);
} else { } else {
console.info("close stream success"): console.info("close stream success");
} }
}); });
``` ```
......
...@@ -20,8 +20,9 @@ import fileio from '@ohos.fileio'; ...@@ -20,8 +20,9 @@ import fileio from '@ohos.fileio';
**Stage模型** **Stage模型**
```js ```js
import Ability from '@ohos.application.Ability'; import UIAbility from '@ohos.app.ability.UIAbility';
class MainAbility extends Ability {
export default class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
let context = this.context; let context = this.context;
let pathDir = context.filesDir; let pathDir = context.filesDir;
...@@ -29,19 +30,18 @@ class MainAbility extends Ability { ...@@ -29,19 +30,18 @@ class MainAbility extends Ability {
} }
``` ```
Stage模型context的具体获取方法参见[Stage模型](js-apis-inner-application-uiAbilityContext.md)
**FA模型** **FA模型**
```js ```js
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
let context = featureAbility.getContext(); let context = featureAbility.getContext();
context.getFilesDir().then((data) => { context.getFilesDir().then((data) => {
let pathDir = data; let pathDir = data;
}) })
``` ```
FA模型context的具体获取方法参见[FA模型](js-apis-inner-app-context.md#Context模块) FA模型context的具体获取方法参见[FA模型](js-apis-inner-app-context.md#Context模块)
## fileio.stat ## fileio.stat
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册