fsync在预览中提供功能 Created-by: goukun Commit-by: goukun Merged-by: openharmony_ci Description: ### 一、内容说明(相关的Issue) https://gitcode.com/openharmony/filemanagement_filemanagement_cangjie_wrapper/issues/45 ### 二、建议测试周期和提测地址 建议测试完成时间:xxxx.xx.xx 投产上线时间:xxxx.xx.xx 提测地址:CI环境/压测环境 测试账号: ### 三、变更内容 * 3.1 关联PR列表 * 3.2 数据库和部署说明 1. 常规更新 2. 重启unicorn 3. 重启sidekiq 4. 迁移任务:是否有迁移任务,没有写 "无" 5. rake脚本:`bundle exec xxx RAILS_ENV = production`;没有写 "无" * 3.4 其他技术优化内容(做了什么,变更了什么) - mock的fsync接口调用FfiOHOSFileFsFsync实现实际功能 * 3.5 废弃通知(什么字段、方法弃用?) * 3.6 后向不兼容变更(是否有无法向后兼容的变更?) ### 四、研发自测点(自测哪些?冒烟用例全部自测?) 自测测试结论: pass ### 五、测试关注点(需要提醒QA重点关注的、可能会忽略的地方) 检查点: | 需求名称 | 是否影响xx公共模块 | 是否需要xx功能 | 需求升级是否依赖其他子产品 | |------|------------|----------|---------------| | xxx | 否 | 需要 | 不需要 | | | | | | 接口测试: 性能测试: 并发测试: 其他: See merge request: openharmony/filemanagement_filemanagement_cangjie_wrapper!65
filemanagement_cangjie_wrapper(beta feature)
Introduction
The filemanagement_cangjie_wrapper is a Cangjie API encapsulated on OpenHarmony for application developers to provide a complete file data management solution. It provides secure and easy-to-use file access capabilities and comprehensive file storage management capabilities. The currently open file management Cangjie api only supports standard devices.
System Architecture
Figure 1 Architecture of the file management subsystem

As shown in the architecture diagram:
Interface layer description:
- Basic File Management API: Cangjie public interfaces based on basic file management encapsulation exposed to developers.
- File URI API: Cangjie public interfaces based on file URI encapsulation exposed to developers.
Framework layer description:
- Basic File Management Wrapper: Basic file management provides file access capabilities, such as creating files, deleting files, modifying files, obtaining file information, and retrieving file lists. This encapsulation layer is a Cangjie encapsulation implementation of file management functionality based on the file access interface.
- File URI Wrapper: File URI provides the ability to obtain the application's own URI. This encapsulation layer is a Cangjie encapsulation implementation of the file URI functionality based on the public file access service.
Cangjie File Management Service Dependencies:
- File Access Interface: Provides capabilities for managing basic files, managing basic directories, and streaming file reading that can be called by the file management Cangjie interface.
- Public File Access Service: Provides file sharing and management service capabilities that can be called by the file management Cangjie interface.
- cangjie_ark_interop: Encapsulates public interfaces for C language interoperation, and provides Cangjie tag class implementation for annotating Cangjie APIs, as well as providing BusinessException exception class definitions thrown to users.
- Cangjie DFX: Responsible for providing log interfaces, providing Cangjie interfaces that can be called by the file management Cangjie interface to print logs at critical paths.
Directory Structure
foundation/filemanagement/filemanagement_cangjie_wrapper
├── figures # architecture pictures
├── kit # Cangjie File Management kit code
│ └── CoreFileKit # Cangjie CoreFileKit implementation
├── ohos # Cangjie File Management code
│ └── file # Cangjie File implementation
│ ├── fileuri # File URI module
│ └── fs # Basic file management module
└── test # Cangjie test code
├── filemanagement # File management tests
└── file_uri # File URI tests
Usage
The current file management Cangjie interface provides the following functions:
- Basic file access capability, including basic file operations such as creating, deleting, and moving files, file information acquisition, and file information setting functions. For details, please refer to Basic File Management API
- File access capability. For details on file access capability, please refer to File URI API.
For relevant guidance, please refer to File Management Usage Guide.
Constraints
- Basic file management interface currently only supports UTF-8/16 encoding.
- File URI currently does not support external storage directories.
Compared with the API capabilities provided by ArkTS, the following functions are not supported:
- Storage management functions.
- Common file function.
- Distributed file management capabilities.
- Application file sharing capabilities.
Code Contribution
Developers are welcome to contribute code, documentation, etc. For specific contribution processes and methods, please refer to Code Contribution.
Repositories Involved
filemanagement_app_file_service