From b2aadc2f58ea9faab210280c0700e07f78f4b33a Mon Sep 17 00:00:00 2001 From: annie_wangli Date: Fri, 25 Feb 2022 14:24:25 +0800 Subject: [PATCH] update docs Signed-off-by: annie_wangli --- .../reference/apis/js-apis-statfs.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-statfs.md b/en/application-dev/reference/apis/js-apis-statfs.md index 2befeb9b4a0..487903b8717 100644 --- a/en/application-dev/reference/apis/js-apis-statfs.md +++ b/en/application-dev/reference/apis/js-apis-statfs.md @@ -6,7 +6,7 @@ ## Modules to Import ```js -import statfs from '@ohos.statfs' +import statfs from '@ohos.statfs'; ``` ## Note @@ -18,7 +18,7 @@ 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: ```js -let path = dir + "xxx.txt" +let path = dir + "xxx.txt"; ``` ## System Capabilities @@ -46,7 +46,12 @@ Obtains the number of free bytes of the specified file system in asynchronous mo - Example ```js - let num = await statfs.getFreeBytes(path); + let path = "/data"; + statfs.getFreeBytes(path).then(function (number){ + console.info("getFreeBytes successfully:"+ number); + }).catch(function(err){ + console.info("getFreeBytes failed with error:"+ err); + }); ``` ## statfs.getFreeBytes @@ -91,7 +96,12 @@ Obtains the total number of bytes of the specified file system in asynchronous m - Example ```js - let num = await statfs.getTotalBytes(path); + let path = "/data"; + statfs.getTotalBytes(path).then(function (number){ + console.info("getTotalBytes successfully:"+ number); + }).catch(function(err){ + console.info("getTotalBytes failed with error:"+ err); + }); ``` ## statfs.getTotalBytes -- Gitee