提交 4a7351a8 编写于 作者: Z zhuhongtao666

fix_statfs

Signed-off-by: Nzhuhongtao666 <zhuhongtao12@huawei.com>
上级 bb166a73
...@@ -34,10 +34,10 @@ getFreeBytes(path:string):Promise&lt;number&gt; ...@@ -34,10 +34,10 @@ getFreeBytes(path:string):Promise&lt;number&gt;
```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&lt;number&gt;): void ...@@ -59,11 +59,11 @@ getFreeBytes(path:string, callback:AsyncCallback&lt;number&gt;): 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&lt;number&gt; ...@@ -92,10 +92,10 @@ getTotalBytes(path: string): Promise&lt;number&gt;
```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&lt;number&gt;): void ...@@ -120,8 +120,8 @@ getTotalBytes(path: string, callback: AsyncCallback&lt;number&gt;): 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.
先完成此消息的编辑!
想要评论请 注册