From 2c762d4db6cf61d9459733a4d26ee477be3cd3f4 Mon Sep 17 00:00:00 2001 From: wenlong12 Date: Mon, 5 Jun 2023 16:32:00 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20f97a83d=20from=20https://gitee.com/wenl?= =?UTF-8?q?ong=5F12/docs=5F1/pulls/19184=20=E6=9B=B4=E6=96=B0hidebug=20js?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E7=A4=BA=E4=BE=8B=20Signed-off-by:wenlong12?= =?UTF-8?q?=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wenlong12 --- .../reference/apis/js-apis-hidebug.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/zh-cn/application-dev/reference/apis/js-apis-hidebug.md b/zh-cn/application-dev/reference/apis/js-apis-hidebug.md index 6e0ff99559..0a32b4464a 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-hidebug.md +++ b/zh-cn/application-dev/reference/apis/js-apis-hidebug.md @@ -179,18 +179,18 @@ import featureAbility from '@ohos.ability.featureAbility' let context = featureAbility.getContext(); context.getFilesDir().then((data) => { - var path = data + "/serviceInfo.txt" - console.info("output path: " + path) - let fd = fs.openSync(path, 0o102, 0o666) - var serviceId = 10 - var args = new Array("allInfo") + var path = data + "/serviceInfo.txt"; + console.info("output path: " + path); + let file = fs.openSync(path, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); + var serviceId = 10; + var args = new Array("allInfo"); try { - hidebug.getServiceDump(serviceId, fd, args) + hidebug.getServiceDump(serviceId, file.fd, args); } catch (error) { - console.info(error.code) - console.info(error.message) + console.info(error.code); + console.info(error.message); } - fs.closeSync(fd); + fs.closeSync(file); }) ``` -- GitLab