Skip to content
This repository was archived by the owner on Dec 11, 2024. It is now read-only.

fix:修复读取文件报错问题 #7

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified harmony/fs.har
Binary file not shown.
2 changes: 1 addition & 1 deletion harmony/fs/oh-package.json5
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-oh-tpl/react-native-fs",
"version": "2.20.0-0.1.4",
"version": "2.20.0-0.1.5",
"description": "Please describe the basic information.",
"main": "index.ets",
"types": "module",
Expand Down
2 changes: 1 addition & 1 deletion harmony/fs/src/main/ets/FsTurboModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export class FsTurboModule extends TurboModule implements TM.ReactNativeFs.Spec
// 读取文件内容
readFile(path: string): Promise<string> {
return new Promise((resolve, reject) => {
let file = fs.openSync(path, fs.OpenMode.READ_WRITE);
let file = fs.openSync(path);
let arrayBuffer = new ArrayBuffer(4096);
fs.read(file.fd, arrayBuffer, (err: BusinessError, readLen: number) => {
if (err) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-oh-tpl/react-native-fs",
"version": "2.20.0-0.1.4",
"version": "2.20.0-0.1.5",
"description": "Native filesystem access for react-native",
"main": "FS.common.js",
"typings": "index.d.ts",
Expand Down