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

!9878 bugfix statfs 修改格式

Merge pull request !9878 from zhuhongtao666/fixstatfs
...@@ -34,10 +34,10 @@ getFreeBytes(path:string):Promise<number> ...@@ -34,10 +34,10 @@ getFreeBytes(path:string):Promise<number>
```js ```js
let path = "/dev"; let path = "/dev";
statfs.getFreeBytes(path).then(function (number){ statfs.getFreeBytes(path).then(function (number) {
console.info("getFreeBytes promise successfully:"+ number); console.info("getFreeBytes promise successfully:" + number);
}).catch(function(err){ }).catch(function (err) {
console.info("getFreeBytes failed with error:"+ err); console.info("getFreeBytes failed with error:" + err);
}); });
``` ```
...@@ -59,11 +59,11 @@ getFreeBytes(path:string, callback:AsyncCallback<number>): void ...@@ -59,11 +59,11 @@ getFreeBytes(path:string, callback:AsyncCallback<number>): void
**示例:** **示例:**
```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(function (path) { context.getFilesDir().then(function (path) {
statfs.getFreeBytes(path, function(err, number){ statfs.getFreeBytes(path, function (err, number) {
console.info("getFreeBytes callback successfully:"+ number); console.info("getFreeBytes callback successfully:" + number);
}); });
}); });
``` ```
...@@ -92,10 +92,10 @@ getTotalBytes(path: string): Promise<number> ...@@ -92,10 +92,10 @@ getTotalBytes(path: string): Promise<number>
```js ```js
let path = "/dev"; let path = "/dev";
statfs.getTotalBytes(path).then(function (number){ statfs.getTotalBytes(path).then(function (number) {
console.info("getTotalBytes promise successfully:"+ number); console.info("getTotalBytes promise successfully:" + number);
}).catch(function(err){ }).catch(function (err) {
console.info("getTotalBytes failed with error:"+ err); console.info("getTotalBytes failed with error:" + err);
}); });
``` ```
...@@ -120,8 +120,8 @@ getTotalBytes(path: string, callback: AsyncCallback<number>): void ...@@ -120,8 +120,8 @@ getTotalBytes(path: string, callback: AsyncCallback<number>): void
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
let context = featureAbility.getContext(); let context = featureAbility.getContext();
context.getFilesDir().then(function (path) { context.getFilesDir().then(function (path) {
statfs.getTotalBytes(path, function(err, number){ statfs.getTotalBytes(path, function(err, number) {
console.info("getTotalBytes callback successfully:"+ number); console.info("getTotalBytes callback successfully:" + number);
}); });
}); });
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册