Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Tonvia
Docs
提交
09b66462
D
Docs
项目概览
Tonvia
/
Docs
与 Fork 源项目一致
Fork自
OpenHarmony / Docs
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
09b66462
编写于
2月 15, 2022
作者:
O
openharmony_ci
提交者:
Gitee
2月 15, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1489 update apis
Merge pull request !1489 from zhangxingxia/master
上级
c6778cef
73eab8cf
变更
4
展开全部
显示空白变更内容
内联
并排
Showing
4 changed file
with
371 addition
and
252 deletion
+371
-252
zh-cn/application-dev/reference/apis/js-apis-environment.md
zh-cn/application-dev/reference/apis/js-apis-environment.md
+4
-4
zh-cn/application-dev/reference/apis/js-apis-fileio.md
zh-cn/application-dev/reference/apis/js-apis-fileio.md
+349
-238
zh-cn/application-dev/reference/apis/js-apis-filemanager.md
zh-cn/application-dev/reference/apis/js-apis-filemanager.md
+4
-6
zh-cn/application-dev/reference/apis/js-apis-statfs.md
zh-cn/application-dev/reference/apis/js-apis-statfs.md
+14
-4
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-environment.md
浏览文件 @
09b66462
...
...
@@ -29,9 +29,9 @@ getStorageDataDir():Promise<string>
```
js
environment
.
getStorageDataDir
().
then
(
function
(
path
){
// do something
console
.
info
(
"
getStorageDataDir successfully:
"
+
path
);
}).
catch
(
function
(
error
){
console
.
info
(
"
getStorageDataDir failed with error:
"
+
error
);
});
```
...
...
@@ -71,9 +71,9 @@ getUserDataDir():Promise<string>
```
js
environment
.
getUserDataDir
().
then
(
function
(
path
){
// do something
console
.
info
(
"
getUserDataDir successfully:
"
+
path
);
}).
catch
(
function
(
error
){
console
.
info
(
"
getUserDataDir failed with error:
"
+
error
);
});
```
...
...
zh-cn/application-dev/reference/apis/js-apis-fileio.md
浏览文件 @
09b66462
此差异已折叠。
点击以展开。
zh-cn/application-dev/reference/apis/js-apis-filemanager.md
浏览文件 @
09b66462
...
...
@@ -4,7 +4,7 @@
## 导入模块
```
js
import
filemanager
from
'
ohos.filemanager
'
import
filemanager
from
'
ohos.filemanager
'
;
```
## 系统能力
...
...
@@ -31,17 +31,15 @@ getRoot(options? : {dev? : DevInfo}) : Promise<FileInfo[]>
-
示例
```
js
filemanager
.
getRoot
()
.
then
((
fileInfo
)
=>
{
filemanager
.
getRoot
().
then
((
fileInfo
)
=>
{
if
(
Array
.
isArray
(
fileInfo
))
{
for
(
var
i
=
0
;
i
<
fileInfo
.
length
;
i
++
)
{
console
.
log
(
JSON
.
Stringify
(
fileInfo
))
}
}
})
.
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
log
(
err
)
})
})
;
```
## filemanager.getRoot
...
...
zh-cn/application-dev/reference/apis/js-apis-statfs.md
浏览文件 @
09b66462
...
...
@@ -6,7 +6,7 @@
## 导入模块
```
js
import
statfs
from
'
@ohos.statfs
'
import
statfs
from
'
@ohos.statfs
'
;
```
## 使用说明
...
...
@@ -18,7 +18,7 @@ import statfs from '@ohos.statfs'
通过上述接口获取到应用目录路径dir,文件名为“xxx.txt”,文件所在绝对路径为:
```
js
let
path
=
dir
+
"
xxx.txt
"
let
path
=
dir
+
"
xxx.txt
"
;
```
## 系统能力
...
...
@@ -46,7 +46,12 @@ getFreeBytes(path:string):Promise<number>
-
示例:
```
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 @@ getTotalBytes.(path:string):Promise<number>
-
示例:
```
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
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录