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

Commit 6cf0667

Browse files
author
baofeng
committed
修复读取文件报错问题
1 parent 62e82c3 commit 6cf0667

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

harmony/fs.har

6.48 KB
Binary file not shown.

harmony/fs/src/main/ets/FsTurboModule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export class FsTurboModule extends TurboModule implements TM.ReactNativeFs.Spec
233233
// 读取文件内容
234234
readFile(path: string): Promise<string> {
235235
return new Promise((resolve, reject) => {
236-
let file = fs.openSync(path, fs.OpenMode.READ_WRITE);
236+
let file = fs.openSync(path);
237237
let arrayBuffer = new ArrayBuffer(4096);
238238
fs.read(file.fd, arrayBuffer, (err: BusinessError, readLen: number) => {
239239
if (err) {

0 commit comments

Comments
 (0)