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

!1572 #I4TD7F已完成,请审校

Merge pull request !1572 from Annie_wang/PR1462
# statfs # statfs
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE:**
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import ## Modules to Import
``` ```js
import statfs from '@ohos.statfs' import statfs from '@ohos.statfs'
``` ```
...@@ -16,13 +17,13 @@ Absolute file or directory path = Application directory + File name or directory ...@@ -16,13 +17,13 @@ Absolute file or directory path = Application directory + File name or directory
For example, if the application directory obtained by using **getOrCreateLocalDir** is **dir** and the file name is **xxx.txt**, the absolute path of the file is as follows: For example, if the application directory obtained by using **getOrCreateLocalDir** is **dir** and the file name is **xxx.txt**, the absolute path of the file is as follows:
``` ```js
let path = dir + "xxx.txt" let path = dir + "xxx.txt"
``` ```
## Required Permissions ## System Capabilities
None SystemCapability.FileManagement.File.FileIO
## statfs.getFreeBytes ## statfs.getFreeBytes
...@@ -44,7 +45,7 @@ Obtains the number of free bytes of the specified file system in asynchronous mo ...@@ -44,7 +45,7 @@ Obtains the number of free bytes of the specified file system in asynchronous mo
- Example - Example
``` ```js
let num = await statfs.getFreeBytes(path); let num = await statfs.getFreeBytes(path);
``` ```
...@@ -63,7 +64,7 @@ Obtains the number of free bytes of the specified file system in asynchronous mo ...@@ -63,7 +64,7 @@ Obtains the number of free bytes of the specified file system in asynchronous mo
- Example - Example
``` ```js
statfs.getFreeBytes(path, function(err, number){ statfs.getFreeBytes(path, function(err, number){
// Do something. // Do something.
}); });
...@@ -89,7 +90,7 @@ Obtains the total number of bytes of the specified file system in asynchronous m ...@@ -89,7 +90,7 @@ Obtains the total number of bytes of the specified file system in asynchronous m
- Example - Example
``` ```js
let num = await statfs.getTotalBytes(path); let num = await statfs.getTotalBytes(path);
``` ```
...@@ -108,7 +109,7 @@ Obtains the total number of bytes of the specified file system in asynchronous m ...@@ -108,7 +109,7 @@ Obtains the total number of bytes of the specified file system in asynchronous m
- Example - Example
``` ```js
statfs.getTotalBytes(path, function(err, number){ statfs.getTotalBytes(path, function(err, number){
// Do something. // Do something.
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册