From bac61a22d8fed05b0da9e50211567d3fa537aa3a Mon Sep 17 00:00:00 2001 From: WangLin305 Date: Fri, 5 Dec 2025 14:51:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=87=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/cpp/FileAccessMethods.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/entry/src/main/cpp/FileAccessMethods.cpp b/entry/src/main/cpp/FileAccessMethods.cpp index c63a591..08a7165 100644 --- a/entry/src/main/cpp/FileAccessMethods.cpp +++ b/entry/src/main/cpp/FileAccessMethods.cpp @@ -107,8 +107,10 @@ static napi_value TransferResourceMgr(napi_env env, napi_callback_info info) { // [End native_manage] size_t fileNameSize; char fileNameBuf[BUFFER_SIZE]; + // [Start convert_fileName] //Convert the passed-in file name into a C-side variable through the Node-API interface. napi_get_value_string_utf8(env, argv[1], fileNameBuf, sizeof(fileNameBuf), &fileNameSize); + // [End convert_fileName] // [Start open_raw_file] //Open a file through a resource object RawFile *rawFile = OH_ResourceManager_OpenRawFile(mNativeResMgr, fileNameBuf); @@ -127,7 +129,7 @@ static napi_value TransferResourceMgr(napi_env env, napi_callback_info info) { napi_value contents; napi_create_string_utf8(env, data.get(), len, &contents); return contents; -} +} // [End source_mg] // [Start write_pick] static napi_value WriteFileUsingPickerFd(napi_env env, napi_callback_info info) { -- Gitee From 5faeadcb0ecc829817fb3061582793445d5a859d Mon Sep 17 00:00:00 2001 From: WangLin305 Date: Fri, 5 Dec 2025 14:53:45 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=87=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/cpp/FileAccessMethods.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entry/src/main/cpp/FileAccessMethods.cpp b/entry/src/main/cpp/FileAccessMethods.cpp index 08a7165..364f2fa 100644 --- a/entry/src/main/cpp/FileAccessMethods.cpp +++ b/entry/src/main/cpp/FileAccessMethods.cpp @@ -129,7 +129,7 @@ static napi_value TransferResourceMgr(napi_env env, napi_callback_info info) { napi_value contents; napi_create_string_utf8(env, data.get(), len, &contents); return contents; -} +} // [End source_mg] // [Start write_pick] static napi_value WriteFileUsingPickerFd(napi_env env, napi_callback_info info) { -- Gitee