Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
312f17e0
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
Fork
28
代码
文件
提交
分支
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看板
提交
312f17e0
编写于
3月 16, 2022
作者:
S
shuzhouhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
文件管理相关文档更新syscap
Signed-off-by:
N
shuzhouhao
<
shuzhouhao@huawei.com
>
上级
73b4a57f
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
304 addition
and
28 deletion
+304
-28
zh-cn/application-dev/reference/apis/js-apis-environment.md
zh-cn/application-dev/reference/apis/js-apis-environment.md
+4
-12
zh-cn/application-dev/reference/apis/js-apis-fileio.md
zh-cn/application-dev/reference/apis/js-apis-fileio.md
+248
-0
zh-cn/application-dev/reference/apis/js-apis-filemanager.md
zh-cn/application-dev/reference/apis/js-apis-filemanager.md
+16
-4
zh-cn/application-dev/reference/apis/js-apis-statfs.md
zh-cn/application-dev/reference/apis/js-apis-statfs.md
+8
-4
zh-cn/application-dev/reference/apis/js-apis-storage-statistics.md
...lication-dev/reference/apis/js-apis-storage-statistics.md
+14
-4
zh-cn/application-dev/reference/apis/js-apis-volumemanager.md
...n/application-dev/reference/apis/js-apis-volumemanager.md
+14
-4
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-environment.md
浏览文件 @
312f17e0
...
@@ -17,9 +17,7 @@ getStorageDataDir():Promise<string>
...
@@ -17,9 +17,7 @@ getStorageDataDir():Promise<string>
异步方法获取内存存储根目录,以promise形式返回结果。
异步方法获取内存存储根目录,以promise形式返回结果。
-
系统能力:
**系统能力**
:SystemCapability.FileManagement.File.Environment
SystemCapability.FileManagement.File.Environment
-
返回值:
-
返回值:
...
@@ -43,9 +41,7 @@ getStorageDataDir(callback:AsyncCallback<string>):void
...
@@ -43,9 +41,7 @@ getStorageDataDir(callback:AsyncCallback<string>):void
异步方法获取内存存储根目录,以callback形式返回结果。
异步方法获取内存存储根目录,以callback形式返回结果。
-
系统能力:
**系统能力**
:SystemCapability.FileManagement.File.Environment
SystemCapability.FileManagement.File.Environment
-
参数:
-
参数:
...
@@ -67,9 +63,7 @@ getUserDataDir():Promise<string>
...
@@ -67,9 +63,7 @@ getUserDataDir():Promise<string>
异步方法获取公共文件根目录,以promise形式返回结果。
异步方法获取公共文件根目录,以promise形式返回结果。
-
系统能力:
**系统能力**
:SystemCapability.FileManagement.File.Environment
SystemCapability.FileManagement.File.Environment
-
返回值:
-
返回值:
...
@@ -93,9 +87,7 @@ getUserDataDir(callback:AsyncCallback<string>): void
...
@@ -93,9 +87,7 @@ getUserDataDir(callback:AsyncCallback<string>): void
异步方法获取公共文件根目录,以callback形式返回结果。
异步方法获取公共文件根目录,以callback形式返回结果。
-
系统能力:
**系统能力**
:SystemCapability.FileManagement.File.Environment
SystemCapability.FileManagement.File.Environment
-
参数:
-
参数:
...
...
zh-cn/application-dev/reference/apis/js-apis-fileio.md
浏览文件 @
312f17e0
...
@@ -42,6 +42,8 @@ stat(path: string): Promise<Stat>
...
@@ -42,6 +42,8 @@ stat(path: string): Promise<Stat>
以异步方法获取文件信息,使用promise形式返回结果。
以异步方法获取文件信息,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -68,6 +70,8 @@ stat(path:string, callback:AsyncCallback<Stat>): void
...
@@ -68,6 +70,8 @@ stat(path:string, callback:AsyncCallback<Stat>): void
以异步方法获取文件信息,使用callback形式返回结果。
以异步方法获取文件信息,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -88,6 +92,8 @@ statSync(path:string): Stat
...
@@ -88,6 +92,8 @@ statSync(path:string): Stat
以同步方法获取文件的信息。
以同步方法获取文件的信息。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -112,6 +118,8 @@ opendir(path: string): Promise<Dir>
...
@@ -112,6 +118,8 @@ opendir(path: string): Promise<Dir>
以异步方法打开文件目录,使用promise形式返回结果。
以异步方法打开文件目录,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -138,6 +146,8 @@ opendir(path: string, callback: AsyncCallback<Dir>): void
...
@@ -138,6 +146,8 @@ opendir(path: string, callback: AsyncCallback<Dir>): void
以异步方法打开文件目录,使用callback形式返回结果。
以异步方法打开文件目录,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -159,6 +169,8 @@ opendirSync(path: string): Dir
...
@@ -159,6 +169,8 @@ opendirSync(path: string): Dir
以同步方法打开文件目录。
以同步方法打开文件目录。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
...
@@ -184,6 +196,8 @@ access(path: string, mode?: number): Promise<void>
...
@@ -184,6 +196,8 @@ access(path: string, mode?: number): Promise<void>
以异步方法检查当前进程是否可访问某文件,使用promise形式返回结果。
以异步方法检查当前进程是否可访问某文件,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:.
-
参数:.
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -211,6 +225,8 @@ access(path: string, mode: number, callback: AsyncCallback<void>): void
...
@@ -211,6 +225,8 @@ access(path: string, mode: number, callback: AsyncCallback<void>): void
以异步方法检查当前进程是否可访问某文件,使用callback形式返回结果。
以异步方法检查当前进程是否可访问某文件,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -232,6 +248,7 @@ accessSync(path: string, mode?: number): void
...
@@ -232,6 +248,7 @@ accessSync(path: string, mode?: number): void
以同步方法检查当前进程是否可访问某文件。
以同步方法检查当前进程是否可访问某文件。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
...
@@ -255,6 +272,8 @@ close(fd: number):Promise<void>
...
@@ -255,6 +272,8 @@ close(fd: number):Promise<void>
以异步方法关闭文件,使用promise形式返回结果。
以异步方法关闭文件,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -282,6 +301,8 @@ close(fd: number, callback:AsyncCallback<void>): void
...
@@ -282,6 +301,8 @@ close(fd: number, callback:AsyncCallback<void>): void
以异步方法关闭文件,使用callback形式返回结果。
以异步方法关闭文件,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -303,6 +324,8 @@ closeSync(fd: number): void
...
@@ -303,6 +324,8 @@ closeSync(fd: number): void
以同步方法关闭文件。
以同步方法关闭文件。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -320,6 +343,8 @@ close(): Promise<void>
...
@@ -320,6 +343,8 @@ close(): Promise<void>
以异步方法关闭文件流,使用promise形式返回结果。
以异步方法关闭文件流,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
返回值:
-
返回值:
| 类型 | 说明 |
| 类型 | 说明 |
| -------- | -------- |
| -------- | -------- |
...
@@ -341,6 +366,8 @@ close(callback: AsyncCallback<void>): void
...
@@ -341,6 +366,8 @@ close(callback: AsyncCallback<void>): void
以异步方法关闭文件流,使用callback形式返回结果。
以异步方法关闭文件流,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -360,6 +387,8 @@ copyFile(src:string | number, dest:string | number, mode?:number):Promise<voi
...
@@ -360,6 +387,8 @@ copyFile(src:string | number, dest:string | number, mode?:number):Promise<voi
以异步方法复制文件,使用promise形式返回结果。
以异步方法复制文件,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -388,6 +417,8 @@ copyFile(src: string | number, dest: string | number, mode: number, callback: As
...
@@ -388,6 +417,8 @@ copyFile(src: string | number, dest: string | number, mode: number, callback: As
以异步方法复制文件,使用callback形式返回结果。
以异步方法复制文件,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -410,6 +441,8 @@ copyFileSync(src: string | number, dest: string | number, mode?: number): void
...
@@ -410,6 +441,8 @@ copyFileSync(src: string | number, dest: string | number, mode?: number): void
以同步方法复制文件。
以同步方法复制文件。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -429,6 +462,7 @@ mkdir(path:string, mode?: number): Promise<void>
...
@@ -429,6 +462,7 @@ mkdir(path:string, mode?: number): Promise<void>
以异步方法创建目录,使用promise形式返回结果。
以异步方法创建目录,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
...
@@ -457,6 +491,8 @@ mkdir(path: string, mode: number, callback: AsyncCallback<void>): void
...
@@ -457,6 +491,8 @@ mkdir(path: string, mode: number, callback: AsyncCallback<void>): void
以异步方法创建目录,使用callback形式返回结果。
以异步方法创建目录,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -480,6 +516,8 @@ mkdirSync(path: string, mode?: number): void
...
@@ -480,6 +516,8 @@ mkdirSync(path: string, mode?: number): void
以同步方法创建目录。
以同步方法创建目录。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -498,6 +536,8 @@ open(path: string, flags?: number, mode?: number): Promise<number>
...
@@ -498,6 +536,8 @@ open(path: string, flags?: number, mode?: number): Promise<number>
以异步的方法打开文件,使用promise形式返回结果。
以异步的方法打开文件,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -526,6 +566,8 @@ open(path: string, flags: number, mode: number, callback: AsyncCallback<numbe
...
@@ -526,6 +566,8 @@ open(path: string, flags: number, mode: number, callback: AsyncCallback<numbe
以异步的方法打开文件,使用callback形式返回结果。
以异步的方法打开文件,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -548,6 +590,8 @@ openSync(path:string, flags?:number, mode?:number): number
...
@@ -548,6 +590,8 @@ openSync(path:string, flags?:number, mode?:number): number
以同步方法打开文件。
以同步方法打开文件。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -576,6 +620,8 @@ read(fd: number, buffer: ArrayBuffer, options?: {
...
@@ -576,6 +620,8 @@ read(fd: number, buffer: ArrayBuffer, options?: {
以异步方法从文件读取数据,使用promise形式返回结果。
以异步方法从文件读取数据,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -610,6 +656,8 @@ read(fd: number, buffer: ArrayBuffer, options: {
...
@@ -610,6 +656,8 @@ read(fd: number, buffer: ArrayBuffer, options: {
以异步方法从文件读取数据,使用callback形式返回结果。
以异步方法从文件读取数据,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -640,6 +688,8 @@ readSync(fd: number, buffer: ArrayBuffer, options?: {
...
@@ -640,6 +688,8 @@ readSync(fd: number, buffer: ArrayBuffer, options?: {
以同步方法从文件读取数据。
以同步方法从文件读取数据。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -666,6 +716,8 @@ rmdir(path: string): Promise<void>
...
@@ -666,6 +716,8 @@ rmdir(path: string): Promise<void>
以异步方法删除目录,使用promise形式返回结果。
以异步方法删除目录,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -692,6 +744,8 @@ rmdir(path: string, callback:AsyncCallback<void>): void
...
@@ -692,6 +744,8 @@ rmdir(path: string, callback:AsyncCallback<void>): void
以异步方法删除目录,使用callback形式返回结果。
以异步方法删除目录,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -712,6 +766,8 @@ rmdirSync(path: string): void
...
@@ -712,6 +766,8 @@ rmdirSync(path: string): void
以同步方法删除目录。
以同步方法删除目录。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -729,6 +785,8 @@ unlink(path:string): Promise<void>
...
@@ -729,6 +785,8 @@ unlink(path:string): Promise<void>
以异步方法删除文件,使用promise形式返回结果。
以异步方法删除文件,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -755,6 +813,8 @@ unlink(path:string, callback:AsyncCallback<void>): void
...
@@ -755,6 +813,8 @@ unlink(path:string, callback:AsyncCallback<void>): void
以异步方法删除文件,使用callback形式返回结果。
以异步方法删除文件,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -777,6 +837,8 @@ unlinkSync(path: string): void
...
@@ -777,6 +837,8 @@ unlinkSync(path: string): void
以同步方法删除文件。
以同步方法删除文件。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -799,6 +861,8 @@ write(fd: number, buffer: ArrayBuffer | string, options?: {
...
@@ -799,6 +861,8 @@ write(fd: number, buffer: ArrayBuffer | string, options?: {
以异步方法将数据写入文件,使用promise形式返回结果。
以异步方法将数据写入文件,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -833,6 +897,8 @@ write(fd: number, buffer: ArrayBuffer | string, options: {
...
@@ -833,6 +897,8 @@ write(fd: number, buffer: ArrayBuffer | string, options: {
以异步方法将数据写入文件,使用callback形式返回结果。
以异步方法将数据写入文件,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -863,6 +929,8 @@ writeSync(fd: number, buffer: ArrayBuffer | string, options?: {
...
@@ -863,6 +929,8 @@ writeSync(fd: number, buffer: ArrayBuffer | string, options?: {
以同步方法将数据写入文件。
以同步方法将数据写入文件。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -888,6 +956,8 @@ hash(path: string, algorithm: string): Promise<string>
...
@@ -888,6 +956,8 @@ hash(path: string, algorithm: string): Promise<string>
以异步方法计算文件的哈希值,使用promise形式返回结果。
以异步方法计算文件的哈希值,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -915,6 +985,8 @@ hash(path: string, algorithm: string, callback: AsyncCallback<string>): vo
...
@@ -915,6 +985,8 @@ hash(path: string, algorithm: string, callback: AsyncCallback<string>): vo
以异步方法计算文件的哈希值,使用callback形式返回结果。
以异步方法计算文件的哈希值,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -938,6 +1010,8 @@ chmod(path: string, mode: number):Promise<void>
...
@@ -938,6 +1010,8 @@ chmod(path: string, mode: number):Promise<void>
以异步方法基于文件路径改变文件权限,使用promise形式返回结果。
以异步方法基于文件路径改变文件权限,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -965,6 +1039,8 @@ chmod(path: string, mode: number, callback: AsyncCallback<void>): void
...
@@ -965,6 +1039,8 @@ chmod(path: string, mode: number, callback: AsyncCallback<void>): void
以异步方法基于文件路径改变文件权限,使用callback形式返回结果。
以异步方法基于文件路径改变文件权限,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -986,6 +1062,8 @@ chmodSync(path: string, mode: number): void
...
@@ -986,6 +1062,8 @@ chmodSync(path: string, mode: number): void
以同步方法基于文件路径改变文件权限。
以同步方法基于文件路径改变文件权限。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1004,6 +1082,8 @@ fstat(fd: number): Promise<Stat>
...
@@ -1004,6 +1082,8 @@ fstat(fd: number): Promise<Stat>
以异步方法基于文件描述符获取文件状态信息,使用promise形式返回结果。
以异步方法基于文件描述符获取文件状态信息,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1030,6 +1110,8 @@ fstat(fd: number, callback: AsyncCallback<Stat>): void
...
@@ -1030,6 +1110,8 @@ fstat(fd: number, callback: AsyncCallback<Stat>): void
以异步方法基于文件描述符获取文件状态信息,使用callback形式返回结果。
以异步方法基于文件描述符获取文件状态信息,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1051,6 +1133,8 @@ fstatSync(fd: number): Stat
...
@@ -1051,6 +1133,8 @@ fstatSync(fd: number): Stat
以同步方法基于文件描述符获取文件状态信息。
以同步方法基于文件描述符获取文件状态信息。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1074,6 +1158,8 @@ ftruncate(fd: number, len?: number): Promise<void>
...
@@ -1074,6 +1158,8 @@ ftruncate(fd: number, len?: number): Promise<void>
以异步方法基于文件描述符截断文件,使用promise形式返回结果。
以异步方法基于文件描述符截断文件,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1102,6 +1188,8 @@ ftruncate(fd: number, len: number, callback:AsyncCallback<void>): void
...
@@ -1102,6 +1188,8 @@ ftruncate(fd: number, len: number, callback:AsyncCallback<void>): void
以异步方法基于文件描述符截断文件,使用callback形式返回结果。
以异步方法基于文件描述符截断文件,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1123,6 +1211,8 @@ ftruncateSync(fd: number, len?: number): void
...
@@ -1123,6 +1211,8 @@ ftruncateSync(fd: number, len?: number): void
以同步方法基于文件描述符截断文件。
以同步方法基于文件描述符截断文件。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1141,6 +1231,8 @@ truncate(path: string, len?: number): Promise<void>
...
@@ -1141,6 +1231,8 @@ truncate(path: string, len?: number): Promise<void>
以异步方法基于文件路径截断文件,使用promise形式返回结果。
以异步方法基于文件路径截断文件,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1168,6 +1260,8 @@ truncate(path: string, len: number, callback:AsyncCallback<void>): void
...
@@ -1168,6 +1260,8 @@ truncate(path: string, len: number, callback:AsyncCallback<void>): void
以异步方法基于文件路径截断文件,使用callback形式返回结果。
以异步方法基于文件路径截断文件,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1189,6 +1283,8 @@ truncateSync(path: string, len?: number): void
...
@@ -1189,6 +1283,8 @@ truncateSync(path: string, len?: number): void
以同步方法基于文件路径截断文件。
以同步方法基于文件路径截断文件。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1211,6 +1307,8 @@ readText(filePath: string, options?: {
...
@@ -1211,6 +1307,8 @@ readText(filePath: string, options?: {
以异步方法基于文本方式读取文件(即直接读取文件的文本内容),使用promise形式返回结果。
以异步方法基于文本方式读取文件(即直接读取文件的文本内容),使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1242,6 +1340,8 @@ readText(filePath: string, options: {
...
@@ -1242,6 +1340,8 @@ readText(filePath: string, options: {
以异步方法基于文本方式读取文件(即直接读取文件的文本内容),使用callback形式返回结果。
以异步方法基于文本方式读取文件(即直接读取文件的文本内容),使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1267,6 +1367,8 @@ readTextSync(filePath: string, options?: {
...
@@ -1267,6 +1367,8 @@ readTextSync(filePath: string, options?: {
以同步方法基于文本方式读取文件(即直接读取文件的文本内容)。
以同步方法基于文本方式读取文件(即直接读取文件的文本内容)。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1290,6 +1392,8 @@ lstat(path: string): Promise<Stat>
...
@@ -1290,6 +1392,8 @@ lstat(path: string): Promise<Stat>
以异步方法获取链接状态信息,使用promise形式返回结果。
以异步方法获取链接状态信息,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1316,6 +1420,8 @@ lstat(path:string, callback:AsyncCallback<Stat>): void
...
@@ -1316,6 +1420,8 @@ lstat(path:string, callback:AsyncCallback<Stat>): void
以异步方法获取链接状态信息,使用callback形式返回结果。
以异步方法获取链接状态信息,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1336,6 +1442,8 @@ lstatSync(path:string): Stat
...
@@ -1336,6 +1442,8 @@ lstatSync(path:string): Stat
以同步方法获取链接状态信息。
以同步方法获取链接状态信息。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1362,6 +1470,8 @@ read(buffer: ArrayBuffer, options?: {
...
@@ -1362,6 +1470,8 @@ read(buffer: ArrayBuffer, options?: {
以异步方法从文件读取数据,使用promise形式返回结果。
以异步方法从文件读取数据,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1393,6 +1503,8 @@ read(buffer: ArrayBuffer, options: {
...
@@ -1393,6 +1503,8 @@ read(buffer: ArrayBuffer, options: {
异步方法从文件读取数据,使用callback形式返回结果。
异步方法从文件读取数据,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1417,6 +1529,8 @@ rename(oldPath: string, newPath: string): Promise<void>
...
@@ -1417,6 +1529,8 @@ rename(oldPath: string, newPath: string): Promise<void>
以异步方法重命名文件,使用promise形式返回结果。
以异步方法重命名文件,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1444,6 +1558,8 @@ rename(oldPath: string, newPath: string, callback: AsyncCallback<void>): v
...
@@ -1444,6 +1558,8 @@ rename(oldPath: string, newPath: string, callback: AsyncCallback<void>): v
以异步方法重命名文件,使用callback形式返回结果。
以异步方法重命名文件,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1464,6 +1580,8 @@ renameSync(oldPath: string, newPath: string): void
...
@@ -1464,6 +1580,8 @@ renameSync(oldPath: string, newPath: string): void
以同步方法重命名文件。
以同步方法重命名文件。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1482,6 +1600,8 @@ fsync(fd: number): Promise<void>
...
@@ -1482,6 +1600,8 @@ fsync(fd: number): Promise<void>
以异步方法同步文件数据,使用promise形式返回结果。
以异步方法同步文件数据,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1508,6 +1628,8 @@ fsync(fd: number, callback: AsyncCallback<void>): void
...
@@ -1508,6 +1628,8 @@ fsync(fd: number, callback: AsyncCallback<void>): void
以异步方法同步文件数据,使用callback形式返回结果。
以异步方法同步文件数据,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1528,6 +1650,8 @@ fsyncSync(fd: number): void
...
@@ -1528,6 +1650,8 @@ fsyncSync(fd: number): void
以同步方法同步文件数据。
以同步方法同步文件数据。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1545,6 +1669,8 @@ fdatasync(fd: number): Promise<void>
...
@@ -1545,6 +1669,8 @@ fdatasync(fd: number): Promise<void>
以异步方法实现文件内容数据同步,使用promise形式返回结果。
以异步方法实现文件内容数据同步,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1571,6 +1697,8 @@ fdatasync(fd: number, callback:AsyncCallback<void>): void
...
@@ -1571,6 +1697,8 @@ fdatasync(fd: number, callback:AsyncCallback<void>): void
以异步方法实现文件内容数据同步,使用callback形式返回结果。
以异步方法实现文件内容数据同步,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1591,6 +1719,8 @@ fdatasyncSync(fd: number): void
...
@@ -1591,6 +1719,8 @@ fdatasyncSync(fd: number): void
以同步方法实现文件内容数据同步。
以同步方法实现文件内容数据同步。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1608,6 +1738,8 @@ symlink(target: string, srcPath: string): Promise<void>
...
@@ -1608,6 +1738,8 @@ symlink(target: string, srcPath: string): Promise<void>
以异步方法基于文件路径创建符号链接,使用promise形式返回结果。
以异步方法基于文件路径创建符号链接,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1635,6 +1767,8 @@ symlink(target: string, srcPath: string, callback: AsyncCallback<void>): v
...
@@ -1635,6 +1767,8 @@ symlink(target: string, srcPath: string, callback: AsyncCallback<void>): v
以异步方法基于文件路径创建符号链接,使用callback形式返回结果。
以异步方法基于文件路径创建符号链接,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1656,6 +1790,8 @@ symlinkSync(target: string, srcPath: string): void
...
@@ -1656,6 +1790,8 @@ symlinkSync(target: string, srcPath: string): void
以同步的方法基于文件路径创建符号链接。
以同步的方法基于文件路径创建符号链接。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1674,6 +1810,8 @@ chown(path: string, uid: number, gid: number): Promise<void>
...
@@ -1674,6 +1810,8 @@ chown(path: string, uid: number, gid: number): Promise<void>
以异步的方法基于文件路径改变文件所有者,使用promise形式返回结果。
以异步的方法基于文件路径改变文件所有者,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1703,6 +1841,8 @@ chown(path: string, uid: number, gid: number, callback: AsyncCallback<void>
...
@@ -1703,6 +1841,8 @@ chown(path: string, uid: number, gid: number, callback: AsyncCallback<void>
以异步的方法基于文件路径改变文件所有者,使用callback形式返回结果。
以异步的方法基于文件路径改变文件所有者,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1726,6 +1866,8 @@ chownSync(path: string, uid: number, gid: number): void
...
@@ -1726,6 +1866,8 @@ chownSync(path: string, uid: number, gid: number): void
以同步的方法基于文件路径改变文件所有者。
以同步的方法基于文件路径改变文件所有者。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1746,6 +1888,8 @@ mkdtemp(prefix: string): Promise<string>
...
@@ -1746,6 +1888,8 @@ mkdtemp(prefix: string): Promise<string>
以异步的方法创建临时目录,使用promise形式返回结果。
以异步的方法创建临时目录,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1772,6 +1916,8 @@ mkdtemp(prefix: string, callback: AsyncCallback<string>): void
...
@@ -1772,6 +1916,8 @@ mkdtemp(prefix: string, callback: AsyncCallback<string>): void
以异步的方法创建临时目录,使用callback形式返回结果。
以异步的方法创建临时目录,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1792,6 +1938,8 @@ mkdtempSync(prefix: string): string
...
@@ -1792,6 +1938,8 @@ mkdtempSync(prefix: string): string
以同步的方法创建临时目录。
以同步的方法创建临时目录。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1814,6 +1962,8 @@ fchmod(fd: number, mode: number): Promise<void>
...
@@ -1814,6 +1962,8 @@ fchmod(fd: number, mode: number): Promise<void>
以异步方法基于文件描述符改变文件权限,使用promise形式返回结果。
以异步方法基于文件描述符改变文件权限,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1841,6 +1991,8 @@ fchmod(fd: number, mode: number, callback: AsyncCallback<void>): void
...
@@ -1841,6 +1991,8 @@ fchmod(fd: number, mode: number, callback: AsyncCallback<void>): void
以异步方法基于文件描述符改变文件权限,使用callback形式返回结果。
以异步方法基于文件描述符改变文件权限,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1862,6 +2014,8 @@ fchmodSync(fd: number, mode: number): void
...
@@ -1862,6 +2014,8 @@ fchmodSync(fd: number, mode: number): void
以同步方法基于文件描述符改变文件权限。
以同步方法基于文件描述符改变文件权限。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1880,6 +2034,8 @@ createStream(path: string, mode: string): Promise<Stream>
...
@@ -1880,6 +2034,8 @@ createStream(path: string, mode: string): Promise<Stream>
以异步方法基于文件路径打开文件流,使用promise形式返回结果。
以异步方法基于文件路径打开文件流,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1907,6 +2063,8 @@ createStream(path: string, mode: string, callback: AsyncCallback<Stream>):
...
@@ -1907,6 +2063,8 @@ createStream(path: string, mode: string, callback: AsyncCallback<Stream>):
以异步方法基于文件路径打开文件流,使用callback形式返回结果。
以异步方法基于文件路径打开文件流,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1928,6 +2086,8 @@ createStreamSync(path: string, mode: string): Stream
...
@@ -1928,6 +2086,8 @@ createStreamSync(path: string, mode: string): Stream
以同步方法基于文件路径打开文件流。
以同步方法基于文件路径打开文件流。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1951,6 +2111,8 @@ fdopenStream(fd: number, mode: string): Promise<Stream>
...
@@ -1951,6 +2111,8 @@ fdopenStream(fd: number, mode: string): Promise<Stream>
以异步方法基于文件描述符打开文件流,使用promise形式返回结果。
以异步方法基于文件描述符打开文件流,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1978,6 +2140,8 @@ fdopenStream(fd: number, mode: string, callback: AsyncCallback<Stream>): v
...
@@ -1978,6 +2140,8 @@ fdopenStream(fd: number, mode: string, callback: AsyncCallback<Stream>): v
以异步方法基于文件描述符打开文件流,使用callback形式返回结果。
以异步方法基于文件描述符打开文件流,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -1999,6 +2163,8 @@ fdopenStreamSync(fd: number, mode: string): Stream
...
@@ -1999,6 +2163,8 @@ fdopenStreamSync(fd: number, mode: string): Stream
以同步方法基于文件描述符打开文件流。
以同步方法基于文件描述符打开文件流。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -2022,6 +2188,8 @@ fchown(fd: number, uid: number, gid: number): Promise<void>
...
@@ -2022,6 +2188,8 @@ fchown(fd: number, uid: number, gid: number): Promise<void>
以异步方法基于文件描述符改变文件所有者,使用promise形式返回结果。
以异步方法基于文件描述符改变文件所有者,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -2051,6 +2219,8 @@ fchown(fd: number, uid: number, gid: number, callback: AsyncCallback<void>
...
@@ -2051,6 +2219,8 @@ fchown(fd: number, uid: number, gid: number, callback: AsyncCallback<void>
以异步方法基于文件描述符改变文件所有者,使用callback形式返回结果。
以异步方法基于文件描述符改变文件所有者,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -2074,6 +2244,8 @@ fchownSync(fd: number, uid: number, gid: number): void
...
@@ -2074,6 +2244,8 @@ fchownSync(fd: number, uid: number, gid: number): void
以同步方法基于文件描述符改变文件所有者。
以同步方法基于文件描述符改变文件所有者。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -2094,6 +2266,8 @@ lchown(path: string, uid: number, gid: number): Promise<void>
...
@@ -2094,6 +2266,8 @@ lchown(path: string, uid: number, gid: number): Promise<void>
以异步方法基于文件路径改变文件所有者,更改符号链接本身的所有者,而不是符号链接所指向的实际文件,使用promise形式返回结果。
以异步方法基于文件路径改变文件所有者,更改符号链接本身的所有者,而不是符号链接所指向的实际文件,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -2123,6 +2297,8 @@ lchown(path: string, uid: number, gid: number, callback: AsyncCallback<void&g
...
@@ -2123,6 +2297,8 @@ lchown(path: string, uid: number, gid: number, callback: AsyncCallback<void&g
以异步方法基于文件路径改变文件所有者,更改符号链接本身的所有者,而不是更改符号链接所指向的实际文件,使用callback形式返回结果。
以异步方法基于文件路径改变文件所有者,更改符号链接本身的所有者,而不是更改符号链接所指向的实际文件,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -2146,6 +2322,8 @@ lchownSync(path: string, uid: number, gid: number): void
...
@@ -2146,6 +2322,8 @@ lchownSync(path: string, uid: number, gid: number): void
以同步方法基于文件路径改变文件所有者,更改符号链接本身的所有者,而不是更改符号链接所指向的实际文件。
以同步方法基于文件路径改变文件所有者,更改符号链接本身的所有者,而不是更改符号链接所指向的实际文件。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -2166,6 +2344,8 @@ createWatcher(filename: string, events: number, callback: AsyncCallback<numbe
...
@@ -2166,6 +2344,8 @@ createWatcher(filename: string, events: number, callback: AsyncCallback<numbe
以异步方法监听文件或者目录的变化,使用callback形式返回结果。
以异步方法监听文件或者目录的变化,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -2190,6 +2370,8 @@ createWatcher(filename: string, events: number, callback: AsyncCallback<numbe
...
@@ -2190,6 +2370,8 @@ createWatcher(filename: string, events: number, callback: AsyncCallback<numbe
仅用于read方法,获取文件的读取结果。
仅用于read方法,获取文件的读取结果。
**系统能力**
:以下各项对应的系统能力均为SystemCapability.FileManagement.File.FileIO。
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| -------- | -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| bytesRead | number | 是 | 是 | 实际读取长度。 |
| bytesRead | number | 是 | 是 | 实际读取长度。 |
...
@@ -2201,6 +2383,7 @@ createWatcher(filename: string, events: number, callback: AsyncCallback<numbe
...
@@ -2201,6 +2383,7 @@ createWatcher(filename: string, events: number, callback: AsyncCallback<numbe
文件具体信息,在调用Stat的方法前,需要先通过
[
stat()
](
#fileiostat
)
方法(同步或异步)来构建一个Stat实例。
文件具体信息,在调用Stat的方法前,需要先通过
[
stat()
](
#fileiostat
)
方法(同步或异步)来构建一个Stat实例。
**系统能力**
:以下各项对应的系统能力均为SystemCapability.FileManagement.File.FileIO。
### 属性
### 属性
...
@@ -2226,6 +2409,8 @@ isBlockDevice(): boolean
...
@@ -2226,6 +2409,8 @@ isBlockDevice(): boolean
用于判断当前目录项是否是块特殊文件。一个块特殊文件只能以块为粒度进行访问,且访问的时候带缓存。
用于判断当前目录项是否是块特殊文件。一个块特殊文件只能以块为粒度进行访问,且访问的时候带缓存。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
返回值:
-
返回值:
| 类型 | 说明 |
| 类型 | 说明 |
| -------- | -------- |
| -------- | -------- |
...
@@ -2243,6 +2428,8 @@ isCharacterDevice(): boolean
...
@@ -2243,6 +2428,8 @@ isCharacterDevice(): boolean
用于判断当前目录项是否是字符特殊文件。一个字符特殊设备可进行随机访问,且访问的时候不带缓存。
用于判断当前目录项是否是字符特殊文件。一个字符特殊设备可进行随机访问,且访问的时候不带缓存。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
返回值:
-
返回值:
| 类型 | 说明 |
| 类型 | 说明 |
| -------- | -------- |
| -------- | -------- |
...
@@ -2260,6 +2447,8 @@ isDirectory(): boolean
...
@@ -2260,6 +2447,8 @@ isDirectory(): boolean
用于判断当前目录项是否是目录。
用于判断当前目录项是否是目录。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
返回值:
-
返回值:
| 类型 | 说明 |
| 类型 | 说明 |
| -------- | -------- |
| -------- | -------- |
...
@@ -2277,6 +2466,8 @@ isFIFO(): boolean
...
@@ -2277,6 +2466,8 @@ isFIFO(): boolean
用于判断当前目录项是否是命名管道(有时也称为FIFO)。命名管道通常用于进程间通信。
用于判断当前目录项是否是命名管道(有时也称为FIFO)。命名管道通常用于进程间通信。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
返回值:
-
返回值:
| 类型 | 说明 |
| 类型 | 说明 |
| -------- | -------- |
| -------- | -------- |
...
@@ -2294,6 +2485,8 @@ isFile(): boolean
...
@@ -2294,6 +2485,8 @@ isFile(): boolean
用于判断当前目录项是否是普通文件。
用于判断当前目录项是否是普通文件。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
返回值:
-
返回值:
| 类型 | 说明 |
| 类型 | 说明 |
| -------- | -------- |
| -------- | -------- |
...
@@ -2311,6 +2504,8 @@ isSocket(): boolean
...
@@ -2311,6 +2504,8 @@ isSocket(): boolean
用于判断当前目录项是否是套接字。
用于判断当前目录项是否是套接字。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
返回值:
-
返回值:
| 类型 | 说明 |
| 类型 | 说明 |
| -------- | -------- |
| -------- | -------- |
...
@@ -2328,6 +2523,8 @@ isSymbolicLink(): boolean
...
@@ -2328,6 +2523,8 @@ isSymbolicLink(): boolean
用于判断当前目录项是否是符号链接。
用于判断当前目录项是否是符号链接。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
返回值:
-
返回值:
| 类型 | 说明 |
| 类型 | 说明 |
| -------- | -------- |
| -------- | -------- |
...
@@ -2350,6 +2547,8 @@ stop(): Promise<void>
...
@@ -2350,6 +2547,8 @@ stop(): Promise<void>
以异步方法关闭watcher监听,使用promise形式返回结果。
以异步方法关闭watcher监听,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
示例:
-
示例:
```
js
```
js
fileio
.
stop
();
fileio
.
stop
();
...
@@ -2362,6 +2561,8 @@ stop(callback: AsyncCallback<void>): void
...
@@ -2362,6 +2561,8 @@ stop(callback: AsyncCallback<void>): void
以异步方法关闭watcher监听,使用callback形式返回结果。
以异步方法关闭watcher监听,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -2386,6 +2587,8 @@ close(): Promise<void>
...
@@ -2386,6 +2587,8 @@ close(): Promise<void>
异步关闭文件流,使用promise形式返回结果。
异步关闭文件流,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
返回值:
-
返回值:
| 类型 | 说明 |
| 类型 | 说明 |
| -------- | -------- |
| -------- | -------- |
...
@@ -2408,6 +2611,8 @@ close(callback: AsyncCallback<void>): void
...
@@ -2408,6 +2611,8 @@ close(callback: AsyncCallback<void>): void
异步关闭文件流,使用callback形式返回结果。
异步关闭文件流,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -2428,6 +2633,8 @@ closeSync(): void
...
@@ -2428,6 +2633,8 @@ closeSync(): void
同步关闭文件流。
同步关闭文件流。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
示例:
-
示例:
```
js
```
js
let
ss
=
fileio
.
createStreamSync
(
path
);
let
ss
=
fileio
.
createStreamSync
(
path
);
...
@@ -2441,6 +2648,8 @@ flush(): Promise<void>
...
@@ -2441,6 +2648,8 @@ flush(): Promise<void>
异步刷新文件流,使用promise形式返回结果。
异步刷新文件流,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
返回值:
-
返回值:
| 类型 | 说明 |
| 类型 | 说明 |
| -------- | -------- |
| -------- | -------- |
...
@@ -2463,6 +2672,8 @@ flush(callback: AsyncCallback<void>): void
...
@@ -2463,6 +2672,8 @@ flush(callback: AsyncCallback<void>): void
异步刷新文件流,使用callback形式返回结果。
异步刷新文件流,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -2483,6 +2694,8 @@ flushSync(): void
...
@@ -2483,6 +2694,8 @@ flushSync(): void
同步刷新文件流。
同步刷新文件流。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
示例:
-
示例:
```
js
```
js
let
ss
=
fileio
.
createStreamSync
(
path
);
let
ss
=
fileio
.
createStreamSync
(
path
);
...
@@ -2501,6 +2714,8 @@ write(buffer: ArrayBuffer | string, options?: {
...
@@ -2501,6 +2714,8 @@ write(buffer: ArrayBuffer | string, options?: {
以异步方法将数据写入流文件,使用promise形式返回结果。
以异步方法将数据写入流文件,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -2534,6 +2749,8 @@ write(buffer: ArrayBuffer | string, options: {
...
@@ -2534,6 +2749,8 @@ write(buffer: ArrayBuffer | string, options: {
以异步方法将数据写入流文件,使用callback形式返回结果。
以异步方法将数据写入流文件,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -2564,6 +2781,8 @@ writeSync(buffer: ArrayBuffer | string, options?: {
...
@@ -2564,6 +2781,8 @@ writeSync(buffer: ArrayBuffer | string, options?: {
以同步方法将数据写入流文件。
以同步方法将数据写入流文件。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -2592,6 +2811,8 @@ read(buffer: ArrayBuffer, options?: {
...
@@ -2592,6 +2811,8 @@ read(buffer: ArrayBuffer, options?: {
以异步方法从流文件读取数据,使用promise形式返回结果。
以异步方法从流文件读取数据,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -2624,6 +2845,8 @@ read(buffer: ArrayBuffer, options: {
...
@@ -2624,6 +2845,8 @@ read(buffer: ArrayBuffer, options: {
以异步方法从流文件读取数据,使用callback形式返回结果。
以异步方法从流文件读取数据,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -2652,6 +2875,8 @@ readSync(buffer: ArrayBuffer, options?: {
...
@@ -2652,6 +2875,8 @@ readSync(buffer: ArrayBuffer, options?: {
以同步方法从流文件读取数据。
以同步方法从流文件读取数据。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -2681,6 +2906,8 @@ read(): Promise<Dirent>
...
@@ -2681,6 +2906,8 @@ read(): Promise<Dirent>
异步读取下一个目录项,使用promise形式返回结果。
异步读取下一个目录项,使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
返回值:
-
返回值:
| 类型 | 说明 |
| 类型 | 说明 |
| -------- | -------- |
| -------- | -------- |
...
@@ -2703,6 +2930,8 @@ read(callback: AsyncCallback<Dirent>): void
...
@@ -2703,6 +2930,8 @@ read(callback: AsyncCallback<Dirent>): void
异步读取下一个目录项,使用callback形式返回结果。
异步读取下一个目录项,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
...
@@ -2726,6 +2955,8 @@ readSync(): Dirent
...
@@ -2726,6 +2955,8 @@ readSync(): Dirent
同步读取下一个目录项。
同步读取下一个目录项。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
返回值:
-
返回值:
| 类型 | 说明 |
| 类型 | 说明 |
| -------- | -------- |
| -------- | -------- |
...
@@ -2744,6 +2975,8 @@ closeSync(): void
...
@@ -2744,6 +2975,8 @@ closeSync(): void
用于关闭目录。目录被关闭后,Dir中持有的文件描述将被释放,后续将无法从Dir中读取目录项。
用于关闭目录。目录被关闭后,Dir中持有的文件描述将被释放,后续将无法从Dir中读取目录项。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
示例:
-
示例:
```
js
```
js
let
dir
=
fileio
.
opendirSync
(
dpath
);
let
dir
=
fileio
.
opendirSync
(
dpath
);
...
@@ -2755,6 +2988,7 @@ closeSync(): void
...
@@ -2755,6 +2988,7 @@ closeSync(): void
在调用Dirent的方法前,需要先通过
[
dir.read()
](
#read
)
方法(同步或异步)来构建一个Dirent实例。
在调用Dirent的方法前,需要先通过
[
dir.read()
](
#read
)
方法(同步或异步)来构建一个Dirent实例。
**系统能力**
:以下各项对应的系统能力均为SystemCapability.FileManagement.File.FileIO。
### 属性
### 属性
...
@@ -2769,6 +3003,8 @@ isBlockDevice(): boolean
...
@@ -2769,6 +3003,8 @@ isBlockDevice(): boolean
用于判断当前目录项是否是块特殊文件。一个块特殊文件只能以块为粒度进行访问,且访问的时候带缓存。
用于判断当前目录项是否是块特殊文件。一个块特殊文件只能以块为粒度进行访问,且访问的时候带缓存。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
返回值:
-
返回值:
| 类型 | 说明 |
| 类型 | 说明 |
| -------- | -------- |
| -------- | -------- |
...
@@ -2787,6 +3023,8 @@ isCharacterDevice(): boolean
...
@@ -2787,6 +3023,8 @@ isCharacterDevice(): boolean
用于判断当前目录项是否是字符特殊设备。一个字符特殊设备可进行随机访问,且访问的时候不带缓存。
用于判断当前目录项是否是字符特殊设备。一个字符特殊设备可进行随机访问,且访问的时候不带缓存。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
返回值:
-
返回值:
| 类型 | 说明 |
| 类型 | 说明 |
| -------- | -------- |
| -------- | -------- |
...
@@ -2805,6 +3043,8 @@ isDirectory(): boolean
...
@@ -2805,6 +3043,8 @@ isDirectory(): boolean
用于判断当前目录项是否是目录。
用于判断当前目录项是否是目录。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
返回值:
-
返回值:
| 类型 | 说明 |
| 类型 | 说明 |
| -------- | -------- |
| -------- | -------- |
...
@@ -2823,6 +3063,8 @@ isFIFO(): boolean
...
@@ -2823,6 +3063,8 @@ isFIFO(): boolean
用于判断当前目录项是否是命名管道(有时也称为FIFO)。命名管道通常用于进程间通信。
用于判断当前目录项是否是命名管道(有时也称为FIFO)。命名管道通常用于进程间通信。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
返回值:
-
返回值:
| 类型 | 说明 |
| 类型 | 说明 |
| -------- | -------- |
| -------- | -------- |
...
@@ -2841,6 +3083,8 @@ isFile(): boolean
...
@@ -2841,6 +3083,8 @@ isFile(): boolean
用于判断当前目录项是否是普通文件。
用于判断当前目录项是否是普通文件。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
返回值:
-
返回值:
| 类型 | 说明 |
| 类型 | 说明 |
| -------- | -------- |
| -------- | -------- |
...
@@ -2859,6 +3103,8 @@ isSocket(): boolean
...
@@ -2859,6 +3103,8 @@ isSocket(): boolean
用于判断当前目录项是否是套接字。
用于判断当前目录项是否是套接字。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
返回值:
-
返回值:
| 类型 | 说明 |
| 类型 | 说明 |
| -------- | -------- |
| -------- | -------- |
...
@@ -2877,6 +3123,8 @@ isSymbolicLink(): boolean
...
@@ -2877,6 +3123,8 @@ isSymbolicLink(): boolean
用于判断当前目录项是否是符号链接。
用于判断当前目录项是否是符号链接。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
返回值:
-
返回值:
| 类型 | 说明 |
| 类型 | 说明 |
| -------- | -------- |
| -------- | -------- |
...
...
zh-cn/application-dev/reference/apis/js-apis-filemanager.md
浏览文件 @
312f17e0
...
@@ -9,16 +9,14 @@
...
@@ -9,16 +9,14 @@
import
filemanager
from
'
@ohos.fileManager
'
;
import
filemanager
from
'
@ohos.fileManager
'
;
```
```
## 系统能力
SystemCapability.FileManagement.FileManagerService
## filemanager.getRoot
## filemanager.getRoot
getRoot(options? : {dev? : DevInfo}) : Promise
<
FileInfo[]
>
getRoot(options? : {dev? : DevInfo}) : Promise
<
FileInfo[]
>
以异步方法获取第一层相册,目录信息。使用promise形式返回结果。
以异步方法获取第一层相册,目录信息。使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.FileManagerService
-
参数
-
参数
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| --- | --- | --- | -- |
| --- | --- | --- | -- |
...
@@ -50,6 +48,8 @@ getRoot(options? : {dev? : DevInfo}, callback : AsyncCallback<FileInfo[]>)
...
@@ -50,6 +48,8 @@ getRoot(options? : {dev? : DevInfo}, callback : AsyncCallback<FileInfo[]>)
以异步方法获取第一层相册,目录信息。使用callback形式返回结果。
以异步方法获取第一层相册,目录信息。使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.FileManagerService
-
参数
-
参数
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
...
@@ -75,6 +75,8 @@ listFile(path : string, type : string, options? : {dev? : DevInfo, offset? : num
...
@@ -75,6 +75,8 @@ listFile(path : string, type : string, options? : {dev? : DevInfo, offset? : num
以异步方法获取第二层相册,文件信息。使用promise形式返回结果。
以异步方法获取第二层相册,文件信息。使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.FileManagerService
-
参数
-
参数
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| --- | --- | --- | -- |
| --- | --- | --- | -- |
...
@@ -118,6 +120,8 @@ listFile(path : string, type : string, options? : {dev? : DevInfo, offset? : num
...
@@ -118,6 +120,8 @@ listFile(path : string, type : string, options? : {dev? : DevInfo, offset? : num
以异步方法获取第二层相册,文件信息。使用callback形式返回结果。
以异步方法获取第二层相册,文件信息。使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.FileManagerService
-
参数
-
参数
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
...
@@ -154,6 +158,8 @@ filemanager.createFile(path : string, filename : string, options? : {dev? : DevI
...
@@ -154,6 +158,8 @@ filemanager.createFile(path : string, filename : string, options? : {dev? : DevI
以异步方法创建文件到指定路径,返回文件uri。使用promise形式返回结果。
以异步方法创建文件到指定路径,返回文件uri。使用promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.FileManagerService
-
参数
-
参数
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| --- | --- | --- | -- |
| --- | --- | --- | -- |
...
@@ -194,6 +200,8 @@ createFile(path : string, filename: string, options? : {dev? : DevInfo}, callbac
...
@@ -194,6 +200,8 @@ createFile(path : string, filename: string, options? : {dev? : DevInfo}, callbac
以异步方法创建文件到指定路径,返回文件uri。使用callback形式返回结果。
以异步方法创建文件到指定路径,返回文件uri。使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.FileManagerService
-
参数
-
参数
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
...
@@ -226,6 +234,8 @@ filemanager.createFile(media_path, name, (err, uri) => {
...
@@ -226,6 +234,8 @@ filemanager.createFile(media_path, name, (err, uri) => {
## FileInfo
## FileInfo
文件信息类型,通过getRoot, listFile等接口返回的类型。
文件信息类型,通过getRoot, listFile等接口返回的类型。
**系统能力**
:以下各项对应的系统能力均为SystemCapability.FileManagement.FileManagerService。
### 属性
### 属性
| 参数名 | 类型 | 可读 | 可写 | 说明 |
| 参数名 | 类型 | 可读 | 可写 | 说明 |
...
@@ -240,6 +250,8 @@ filemanager.createFile(media_path, name, (err, uri) => {
...
@@ -240,6 +250,8 @@ filemanager.createFile(media_path, name, (err, uri) => {
## DevInfo
## DevInfo
设备类型,配置接口访问的设备类型。
设备类型,配置接口访问的设备类型。
**系统能力**
:以下各项对应的系统能力均为SystemCapability.FileManagement.FileManagerService。
### 属性
### 属性
| 参数名 | 类型 | 可读 | 可写 | 说明 |
| 参数名 | 类型 | 可读 | 可写 | 说明 |
...
...
zh-cn/application-dev/reference/apis/js-apis-statfs.md
浏览文件 @
312f17e0
...
@@ -21,16 +21,14 @@ import statfs from '@ohos.statfs';
...
@@ -21,16 +21,14 @@ import statfs from '@ohos.statfs';
let
path
=
dir
+
"
xxx.txt
"
;
let
path
=
dir
+
"
xxx.txt
"
;
```
```
## 系统能力
SystemCapability.FileManagement.File.FileIO
## statfs.getFreeBytes
## statfs.getFreeBytes
getFreeBytes(path:string):Promise
<
number
>
getFreeBytes(path:string):Promise
<
number
>
异步方法获取指定文件系统空闲字节数,以Promise形式返回结果。
异步方法获取指定文件系统空闲字节数,以Promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
...
@@ -60,6 +58,8 @@ getFreeBytes(path:string, callback:AsyncCallback<number>): void
...
@@ -60,6 +58,8 @@ getFreeBytes(path:string, callback:AsyncCallback<number>): void
异步方法获取指定文件系统空闲字节数,使用callback形式返回结果。
异步方法获取指定文件系统空闲字节数,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
...
@@ -81,6 +81,8 @@ getTotalBytes(path: string): Promise<number>
...
@@ -81,6 +81,8 @@ getTotalBytes(path: string): Promise<number>
异步方法获取指定文件系统总字节数,以Promise形式返回结果。
异步方法获取指定文件系统总字节数,以Promise形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数 | 类型 | 必填 | 说明 |
| 参数 | 类型 | 必填 | 说明 |
...
@@ -110,6 +112,8 @@ getTotalBytes(path: string, callback: AsyncCallback<number>): void
...
@@ -110,6 +112,8 @@ getTotalBytes(path: string, callback: AsyncCallback<number>): void
异步方法获取指定文件系统总字节数,使用callback形式返回结果。
异步方法获取指定文件系统总字节数,使用callback形式返回结果。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
...
...
zh-cn/application-dev/reference/apis/js-apis-storage-statistics.md
浏览文件 @
312f17e0
...
@@ -11,16 +11,14 @@
...
@@ -11,16 +11,14 @@
import
storagestatistics
from
"
@ohos.storageStatistics
"
;
import
storagestatistics
from
"
@ohos.storageStatistics
"
;
```
```
## 系统能力
SystemCapability.FileManagement.StorageService.SpatialStatistics
## storagestatistics.getTotalSizeOfVolume
## storagestatistics.getTotalSizeOfVolume
getTotalSizeOfVolume(volumeUuid: string): Promise
<
number
>
getTotalSizeOfVolume(volumeUuid: string): Promise
<
number
>
异步获取指定卷的总空间大小,以promise方式返回。
异步获取指定卷的总空间大小,以promise方式返回。
**系统能力**
:SystemCapability.FileManagement.StorageService.SpatialStatistics
-
参数
-
参数
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
...
@@ -50,6 +48,8 @@ getTotalSizeOfVolume(volumeUuid: string, callback:AsyncCallback<number>):v
...
@@ -50,6 +48,8 @@ getTotalSizeOfVolume(volumeUuid: string, callback:AsyncCallback<number>):v
异步获取指定卷的总空间大小,以callback方式返回。
异步获取指定卷的总空间大小,以callback方式返回。
**系统能力**
:SystemCapability.FileManagement.StorageService.SpatialStatistics
-
参数
-
参数
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
...
@@ -75,6 +75,8 @@ getFreeSizeOfVolume(volumeUuid: string): Promise<number>
...
@@ -75,6 +75,8 @@ getFreeSizeOfVolume(volumeUuid: string): Promise<number>
异步获取指定卷的可用空间大小,以promise方式返回。
异步获取指定卷的可用空间大小,以promise方式返回。
**系统能力**
:SystemCapability.FileManagement.StorageService.SpatialStatistics
-
参数
-
参数
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
...
@@ -105,6 +107,8 @@ getFreeSizeOfVolume(volumeUuid: string, callback:AsyncCallback<number>):vo
...
@@ -105,6 +107,8 @@ getFreeSizeOfVolume(volumeUuid: string, callback:AsyncCallback<number>):vo
异步获取指定卷的可用空间大小,以callback方式返回。
异步获取指定卷的可用空间大小,以callback方式返回。
**系统能力**
:SystemCapability.FileManagement.StorageService.SpatialStatistics
-
参数
-
参数
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
...
@@ -128,6 +132,8 @@ getBundleStats(packageName: string): Promise<BundleStats>
...
@@ -128,6 +132,8 @@ getBundleStats(packageName: string): Promise<BundleStats>
异步获取应用存储状态,以promise方式返回。
异步获取应用存储状态,以promise方式返回。
**系统能力**
:SystemCapability.FileManagement.StorageService.SpatialStatistics
-
参数
-
参数
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
...
@@ -157,6 +163,8 @@ getBundleStats(packageName: string, callback: AsyncCallback<BundleStats>)
...
@@ -157,6 +163,8 @@ getBundleStats(packageName: string, callback: AsyncCallback<BundleStats>)
异步获取应用存储状态,以callback方式返回。
异步获取应用存储状态,以callback方式返回。
**系统能力**
:SystemCapability.FileManagement.StorageService.SpatialStatistics
-
参数
-
参数
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
...
@@ -176,6 +184,8 @@ getBundleStats(packageName: string, callback: AsyncCallback<BundleStats>)
...
@@ -176,6 +184,8 @@ getBundleStats(packageName: string, callback: AsyncCallback<BundleStats>)
## BundleStats<sup>9+</sup>
## BundleStats<sup>9+</sup>
**系统能力**
:以下各项对应的系统能力均为SystemCapability.FileManagement.StorageService.SpatialStatistics。
### 属性
### 属性
| 名称 | 类型 | 说明 |
| 名称 | 类型 | 说明 |
...
...
zh-cn/application-dev/reference/apis/js-apis-volumemanager.md
浏览文件 @
312f17e0
...
@@ -11,16 +11,14 @@
...
@@ -11,16 +11,14 @@
import
volumemanager
from
"
@ohos.volumeManager
"
;
import
volumemanager
from
"
@ohos.volumeManager
"
;
```
```
## 系统能力
SystemCapability.FileManagement.StorageService.Volume
## volumemanager.getAllVolumes
## volumemanager.getAllVolumes
getAllVolumes(): Promise
<
Array
<
Volume
>>
getAllVolumes(): Promise
<
Array
<
Volume
>>
异步获取当前所有可获得的卷信息,以promise方式返回。
异步获取当前所有可获得的卷信息,以promise方式返回。
**系统能力**
:SystemCapability.FileManagement.StorageService.Volume
-
返回值
-
返回值
| 类型 | 说明 |
| 类型 | 说明 |
...
@@ -41,6 +39,8 @@ getAllVolumes(callback: AsyncCallback<Array<Volume>>): void
...
@@ -41,6 +39,8 @@ getAllVolumes(callback: AsyncCallback<Array<Volume>>): void
异步获取当前所有可获得的卷信息,以callback方式返回。
异步获取当前所有可获得的卷信息,以callback方式返回。
**系统能力**
:SystemCapability.FileManagement.StorageService.Volume
-
参数
-
参数
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
...
@@ -63,6 +63,8 @@ mount(volumeId: string): Promise<boolean>
...
@@ -63,6 +63,8 @@ mount(volumeId: string): Promise<boolean>
异步挂载指定卷,以promise方式返回。
异步挂载指定卷,以promise方式返回。
**系统能力**
:SystemCapability.FileManagement.StorageService.Volume
-
参数
-
参数
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
...
@@ -90,6 +92,8 @@ mount(volumeId: string, callback:AsyncCallback<boolean>):void
...
@@ -90,6 +92,8 @@ mount(volumeId: string, callback:AsyncCallback<boolean>):void
异步获取指定卷的可用空间大小,以callback方式返回。
异步获取指定卷的可用空间大小,以callback方式返回。
**系统能力**
:SystemCapability.FileManagement.StorageService.Volume
-
参数
-
参数
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
...
@@ -112,6 +116,8 @@ unmount(volumeId: string): Promise<boolean>
...
@@ -112,6 +116,8 @@ unmount(volumeId: string): Promise<boolean>
异步卸载指定卷,以promise方式返回。
异步卸载指定卷,以promise方式返回。
**系统能力**
:SystemCapability.FileManagement.StorageService.Volume
-
参数
-
参数
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
...
@@ -139,6 +145,8 @@ unmount(volumeId: string, callback:AsyncCallback<boolean>):void
...
@@ -139,6 +145,8 @@ unmount(volumeId: string, callback:AsyncCallback<boolean>):void
异步卸载指定卷,以callback方式返回。
异步卸载指定卷,以callback方式返回。
**系统能力**
:SystemCapability.FileManagement.StorageService.Volume
-
参数
-
参数
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
...
@@ -157,6 +165,8 @@ unmount(volumeId: string, callback:AsyncCallback<boolean>):void
...
@@ -157,6 +165,8 @@ unmount(volumeId: string, callback:AsyncCallback<boolean>):void
## Volume<sup>9+</sup>
## Volume<sup>9+</sup>
**系统能力**
:以下各项对应的系统能力均为SystemCapability.FileManagement.StorageService.Volume。
### 属性
### 属性
| 名称 | 类型 | 说明 |
| 名称 | 类型 | 说明 |
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录