提交 211de98a 编写于 作者: A Annie_wang

update docs

Signed-off-by: NAnnie_wang <annie.wangli@huawei.com>
上级 29f6acd4
......@@ -22,6 +22,7 @@ Obtains information about the root album or directory in asynchronous mode. This
**System capability**: SystemCapability.FileManagement.UserFileService
**Parameters**
| Name| Type| Mandatory| Description|
| --- | --- | --- | -- |
| options | Object | No| The options are as follows:<br>- &nbsp;**dev**: See [DevInfo](#devinfo). It is **dev = {name: "local"}** by default if not specified. Currently, only 'local' is supported.|
......@@ -83,6 +84,7 @@ Obtains information about the second-level album or files in asynchronous mode.
**System capability**: SystemCapability.FileManagement.UserFileService
**Parameters**
| Name| Type| Mandatory| Description|
| --- | --- | --- | -- |
| path | string | Yes| URI of the directory to query.|
......@@ -169,6 +171,7 @@ Creates a file in the specified path in asynchronous mode. This API uses a promi
**System capability**: SystemCapability.FileManagement.UserFileService
**Parameters**
| Name| Type| Mandatory| Description|
| --- | --- | --- | -- |
| filename | string | Yes| Name of the file to create.|
......
......@@ -18,26 +18,26 @@ Obtains the number of free bytes of the specified file system in asynchronous mo
**System capability**: SystemCapability.FileManagement.File.FileIO
- **Parameters**
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ---------------------------- |
| path | string | Yes | File path of the file system.|
- Return value
**Return value**
| Type | Description |
| --------------------- | -------------- |
| Promise&lt;number&gt; | Promise used to return the number of free bytes obtained.|
- Example
**Example**
```js
let path = "/dev";
statfs.getFreeBytes(path).then(function (number){
console.info("getFreeBytes promise successfully:"+ number);
}).catch(function(err){
console.info("getFreeBytes failed with error:"+ err);
statfs.getFreeBytes(path).then(function (number) {
console.info("getFreeBytes promise successfully:" + number);
}).catch(function (err) {
console.info("getFreeBytes failed with error:" + err);
});
```
......@@ -49,21 +49,21 @@ Obtains the number of free bytes of the specified file system in asynchronous mo
**System capability**: SystemCapability.FileManagement.File.FileIO
- **Parameters**
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | --------------------------- | ---- | ---------------------------- |
| path | string | Yes | File path of the file system.|
| callback | AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the number of free bytes obtained.|
- Example
**Example**
```js
import featureAbility from '@ohos.ability.featureAbility';
import featureAbility from '@ohos.ability.featureAbility';
let context = featureAbility.getContext();
context.getFilesDir().then(function (path) {
statfs.getFreeBytes(path, function(err, number){
console.info("Got free bytes successfully:"+ number);
statfs.getFreeBytes(path, function (err, number) {
console.info("getFreeBytes callback successfully:" + number);
});
});
```
......@@ -76,26 +76,26 @@ Obtains the total number of bytes of the specified file system in asynchronous m
**System capability**: SystemCapability.FileManagement.File.FileIO
- **Parameters**
**Parameters**
| Name| Type | Mandatory| Description |
| ---- | ------ | ---- | ---------------------------- |
| path | string | Yes | File path of the file system.|
- Return value
**Return value**
| Type | Description |
| --------------------- | ------------ |
| Promise&lt;number&gt; | Promise used to return the total number of bytes obtained.|
- Example
**Example**
```js
let path = "/dev";
statfs.getTotalBytes(path).then(function (number){
console.info("getTotalBytes promise successfully:"+ number);
}).catch(function(err){
console.info("getTotalBytes failed with error:"+ err);
statfs.getTotalBytes(path).then(function (number) {
console.info("getTotalBytes promise successfully:" + number);
}).catch(function (err) {
console.info("getTotalBytes failed with error:" + err);
});
```
......@@ -107,21 +107,21 @@ Obtains the total number of bytes of the specified file system in asynchronous m
**System capability**: SystemCapability.FileManagement.File.FileIO
- **Parameters**
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | --------------------------- | ---- | ---------------------------- |
| path | string | Yes | File path of the file system.|
| callback | AsyncCallback&lt;number&gt; | Yes | Callback invoked to return the total number of bytes obtained. |
- Example
**Example**
```js
import featureAbility from '@ohos.ability.featureAbility';
let context = featureAbility.getContext();
context.getFilesDir().then(function (path) {
statfs.getTotalBytes(path, function(err, number){
console.info("Got total bytes successfully:"+ number);
statfs.getTotalBytes(path, function(err, number) {
console.info("getTotalBytes callback successfully:" + number);
});
});
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册