Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
51217be6
D
Docs
项目概览
OpenHarmony
/
Docs
大约 1 年 前同步成功
通知
159
Star
292
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看板
提交
51217be6
编写于
4月 26, 2023
作者:
Z
zengyawen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update docs
Signed-off-by:
N
zengyawen
<
zengyawen1@huawei.com
>
上级
8db8c2db
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
14 addition
and
13 deletion
+14
-13
zh-cn/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-filemanagement.md
...ngelogs/OpenHarmony_3.2.10.5/changelogs-filemanagement.md
+14
-13
未找到文件。
zh-cn/release-notes/changelogs/OpenHarmony_3.2.10.5/changelogs-filemanagement.md
浏览文件 @
51217be6
...
@@ -155,34 +155,35 @@ file_api部件fileio接口返回值不包含错误码error.code,现进行错
...
@@ -155,34 +155,35 @@ file_api部件fileio接口返回值不包含错误码error.code,现进行错
**关键接口/组件变更**
**关键接口/组件变更**
为适配统一的API异常处理方式,对fileio相关接口进行废弃,并新增对应接口,原接口位于@ohos.fileio,新接口位于@ohos.file.fs。新增接口支持统一的错误码异常处理规范,功能上与原接口保持一致,参数上有微调,以下为规格调整的接口列表。
为适配统一的API异常处理方式,对fileio相关接口进行废弃,并新增对应接口,原接口位于@ohos.fileio,新接口位于@ohos.file.fs。新增接口支持统一的错误码异常处理规范,功能上与原接口保持一致,参数上有微调,以下为规格调整的接口列表。
废弃与新增方法同名,请在列表中对应查看。
| 模块名 | 方法/属性/枚举/常量 | 变更类型 |
| 模块名 | 方法/属性/枚举/常量 | 变更类型 |
| ------------------------- | ------------------------------------------------------------ | -------- |
| ------------------------- | ------------------------------------------------------------ | -------- |
| @ohos.fileio |
**function**
access(path: string, mode?: number, callback?: AsyncCallback
<void>
): void
\|
Promise
<void>
| 废弃 |
| @ohos.fileio |
**function**
access(path: string, mode?: number, callback?: AsyncCallback
\<
void>): void
\|
Promise
\
<
void> | 废弃 |
| @ohos.fileio |
**function**
accessSync(path: string, mode?: number): void | 废弃 |
| @ohos.fileio |
**function**
accessSync(path: string, mode?: number): void | 废弃 |
| @ohos.file.fs |
**function**
access(path: string, callback?: AsyncCallback
<boolean>
): void
\|
Promise
<boolean>
| 新增 |
| @ohos.file.fs |
**function**
access(path: string, callback?: AsyncCallback
\<
boolean>): void
\|
Promise
\
<
boolean> | 新增 |
| @ohos.file.fs |
**function**
accessSync(path: string): boolean | 新增 |
| @ohos.file.fs |
**function**
accessSync(path: string): boolean | 新增 |
| @ohos.fileio |
**function**
close(fd: number, callback?: AsyncCallback
<void>
): void
\|
Promise
<void>
| 废弃 |
| @ohos.fileio |
**function**
close(fd: number, callback?: AsyncCallback
\<
void>): void
\|
Promise
\
<
void> | 废弃 |
| @ohos.fileio |
**function**
closeSync(fd: number): void | 废弃 |
| @ohos.fileio |
**function**
closeSync(fd: number): void | 废弃 |
| @ohos.file.fs |
**function**
close(file: File
\|
number, callback?: AsyncCallback
<void>
): void
\|
Promise
<void>
| 新增 |
| @ohos.file.fs |
**function**
close(file: File
\|
number, callback?: AsyncCallback
\<
void>): void
\|
Promise
\
<
void> | 新增 |
| @ohos.file.fs |
**function**
closeSync(file: File
\|
number): void | 新增 |
| @ohos.file.fs |
**function**
closeSync(file: File
\|
number): void | 新增 |
| @ohos.fileio |
**function**
mkdir(path: string, mode?: number, callback?: AsyncCallback
<void>
): void
\|
Promise
<void>
| 废弃 |
| @ohos.fileio |
**function**
mkdir(path: string, mode?: number, callback?: AsyncCallback
\<
void>): void
\|
Promise
\
<
void> | 废弃 |
| @ohos.fileio |
**function**
mkdirSync(path: string, mode?: number): void | 废弃 |
| @ohos.fileio |
**function**
mkdirSync(path: string, mode?: number): void | 废弃 |
| @ohos.file.fs |
**function**
mkdir(path: string, callback?: AsyncCallback
<void>
): void
\|
Promise
<void>
| 新增 |
| @ohos.file.fs |
**function**
mkdir(path: string, callback?: AsyncCallback
\<
void>): void
\|
Promise
\
<
void> | 新增 |
| @ohos.file.fs |
**function**
mkdirSync(path: string): void | 新增 |
| @ohos.file.fs |
**function**
mkdirSync(path: string): void | 新增 |
| @ohos.fileio |
**function**
readText(filePath: string, options?: { position?: number; length?: number; encoding?: string; }, callback?: AsyncCallback
<string>
): void
\|
Promise
<string>
| 废弃 |
| @ohos.fileio |
**function**
readText(filePath: string, options?: { position?: number; length?: number; encoding?: string; }, callback?: AsyncCallback
\<
string>): void
\|
Promise
\
<
string> | 废弃 |
| @ohos.fileio |
**function**
readTextSync(filePath: string, options?: { position?: number; length?: number; encoding?: string; }): string | 废弃 |
| @ohos.fileio |
**function**
readTextSync(filePath: string, options?: { position?: number; length?: number; encoding?: string; }): string | 废弃 |
| @ohos.file.fs |
**function**
readText(filePath: string, options?: { offset?: number; length?: number; encoding?: string; }, callback?: AsyncCallback
<string>
): void
\|
Promise
<string>
| 新增 |
| @ohos.file.fs |
**function**
readText(filePath: string, options?: { offset?: number; length?: number; encoding?: string; }, callback?: AsyncCallback
\<
string>): void
\|
Promise
\
<
string> | 新增 |
| @ohos.file.fs |
**function**
readTextSync(filePath: string, options?: { offset?: number; length?: number; encoding?: string; }): string | 新增 |
| @ohos.file.fs |
**function**
readTextSync(filePath: string, options?: { offset?: number; length?: number; encoding?: string; }): string | 新增 |
| @ohos.fileio |
**function**
Stream.read(buffer: ArrayBuffer, options?: { offset?: number; length?: number; position?: number; }, callback?: AsyncCallback
<ReadOut>
): void
\|
Promise
<ReadOut>
| 废弃 |
| @ohos.fileio |
**function**
Stream.read(buffer: ArrayBuffer, options?: { offset?: number; length?: number; position?: number; }, callback?: AsyncCallback
\<
ReadOut>): void
\|
Promise
\
<
ReadOut> | 废弃 |
| @ohos.fileio |
**function**
Stream.readSync(buffer: ArrayBuffer, options?: { offset?: number; length?: number; position?: number; }): number | 废弃 |
| @ohos.fileio |
**function**
Stream.readSync(buffer: ArrayBuffer, options?: { offset?: number; length?: number; position?: number; }): number | 废弃 |
| @ohos.file.fs |
**function**
Stream.read(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; }, callback?: AsyncCallback
<number>
): void
\|
Promise
<number>
| 新增 |
| @ohos.file.fs |
**function**
Stream.read(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; }, callback?: AsyncCallback
\<
number>): void
\|
Promise
\
<
number> | 新增 |
| @ohos.file.fs |
**function**
Stream.readSync(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; }): number | 新增 |
| @ohos.file.fs |
**function**
Stream.readSync(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; }): number | 新增 |
| @ohos.fileio |
**function**
Stream.write(buffer: ArrayBuffer
\|
string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }, callback?: AsyncCallback
<number>
): void
\|
Promise
<void>
| 废弃 |
| @ohos.fileio |
**function**
Stream.write(buffer: ArrayBuffer
\|
string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }, callback?: AsyncCallback
\<
number>): void
\|
Promise
\
<
void> | 废弃 |
| @ohos.fileio |
**function**
Stream.writeSync(buffer: ArrayBuffer
\|
string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }): number | 废弃 |
| @ohos.fileio |
**function**
Stream.writeSync(buffer: ArrayBuffer
\|
string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }): number | 废弃 |
| @ohos.file.fs |
**function**
Stream.write(buffer: ArrayBuffer
\|
string, options?: { offset?: number; length?: number; encoding?: string; }, callback?: AsyncCallback
<number>
): void
\|
Promise
<void>
| 新增 |
| @ohos.file.fs |
**function**
Stream.write(buffer: ArrayBuffer
\|
string, options?: { offset?: number; length?: number; encoding?: string; }, callback?: AsyncCallback
\<
number>): void
\|
Promise
\
<
void> | 新增 |
| @ohos.file.fs |
**function**
Stream.writeSync(buffer: ArrayBuffer
\|
string, options?: { offset?: number; length?: number; encoding?: string; }): number | 新增 |
| @ohos.file.fs |
**function**
Stream.writeSync(buffer: ArrayBuffer
\|
string, options?: { offset?: number; length?: number; encoding?: string; }): number | 新增 |
**适配指导**
**适配指导**
@ohos.file.fs新增统一的API异常处理方式,
可参考错误码
[
适配指导
](
../../../application-dev/reference/errorcodes/errorcode-filemanagement.md#错误码适配指导
)
。
@ohos.file.fs新增统一的API异常处理方式,
具体示例代码请参考
[
接口文档
](
../../../application-dev/reference/apis/js-apis-file-fs.md
)
。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录