提交 97859f3e 编写于 作者: Z zhangxingxia

update statfs apis

Signed-off-by: Nzhangxingxia <zhangxingxia1@huawei.com>
上级 b75aa8d8
# statfs
> ![icon-note.gif](D:/docs/zh-cn/application-dev/reference/apis/public_sys-resources/icon-note.gif) **说明:**
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
```
```js
import statfs from '@ohos.statfs'
```
......@@ -16,13 +17,13 @@ import statfs from '@ohos.statfs'
通过上述接口获取到应用目录路径dir,文件名为“xxx.txt”,文件所在绝对路径为:
```
```js
let path = dir + "xxx.txt"
```
## 权限列表
## 系统能力
SystemCapability.FileManagement.File.FileIO
## statfs.getFreeBytes
......@@ -44,7 +45,7 @@ getFreeBytes(path:string):Promise&lt;number&gt;
- 示例:
```
```js
let num = await statfs.getFreeBytes(path);
```
......@@ -63,7 +64,7 @@ getFreeBytes(path:string, callback:AsyncCallback&lt;number&gt;): void
- 示例:
```
```js
statfs.getFreeBytes(path, function(err, number){
//do something
});
......@@ -89,7 +90,7 @@ getTotalBytes.(path:string):Promise&lt;number&gt;
- 示例:
```
```js
let num = await statfs.getTotalBytes(path);
```
......@@ -108,7 +109,7 @@ getTotalBytes(path:string, callback:AsyncCallback&lt;number&gt;): void
- 示例:
```
```js
statfs.getTotalBytes(path, function(err, number){
//do something
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册