未验证 提交 f68e8ce2 编写于 作者: O openharmony_ci 提交者: Gitee

!17342 fileio接口升级为fs,更新文档

Merge pull request !17342 from wenlong_12/master
...@@ -173,7 +173,7 @@ getServiceDump(serviceid : number, fd : number, args : Array\<string>) : void ...@@ -173,7 +173,7 @@ getServiceDump(serviceid : number, fd : number, args : Array\<string>) : void
**示例:** **示例:**
```js ```js
import fileio from '@ohos.fileio' import fs from '@ohos.file.fs'
import hidebug from '@ohos.hidebug' import hidebug from '@ohos.hidebug'
import featureAbility from '@ohos.ability.featureAbility' import featureAbility from '@ohos.ability.featureAbility'
...@@ -181,7 +181,7 @@ let context = featureAbility.getContext(); ...@@ -181,7 +181,7 @@ let context = featureAbility.getContext();
context.getFilesDir().then((data) => { context.getFilesDir().then((data) => {
var path = data + "/serviceInfo.txt" var path = data + "/serviceInfo.txt"
console.info("output path: " + path) console.info("output path: " + path)
let fd = fileio.openSync(path, 0o102, 0o666) let fd = fs.openSync(path, 0o102, 0o666)
var serviceId = 10 var serviceId = 10
var args = new Array("allInfo") var args = new Array("allInfo")
try { try {
...@@ -190,7 +190,7 @@ context.getFilesDir().then((data) => { ...@@ -190,7 +190,7 @@ context.getFilesDir().then((data) => {
console.info(error.code) console.info(error.code)
console.info(error.message) console.info(error.message)
} }
fileio.closeSync(fd); fs.closeSync(fd);
}) })
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册