提交 d1d3be68 编写于 作者: S Storage sandboxing

mod environment xts

Signed-off-by: NStorage sandboxing <raoxian@huawei.com>
上级 d64e6f6e
......@@ -14,9 +14,6 @@
*/
import environment from '@ohos.environment';
import process from '@ohos.process';
import fileio from '@ohos.fileio';
import {
describe, beforeAll, beforeEach, afterEach, afterAll, it, expect
......@@ -30,24 +27,6 @@ function isString(str) {
return typeof str == "string" && str.constructor == String;
}
async function readFile(path){
let fd = fileio.openSync(path);
let buf = new ArrayBuffer(4096);
let readOut = await fileio.read(fd, buf);
let dataStr = String.fromCharCode.apply(null, new Uint8Array(readOut.buffer));
return dataStr;
}
async function executeRunCmd(command){
console.log(`cmd===${command}`);
let child = await process.runCmd(command);
let result = child.wait();
let val = await child.getOutput();
console.log("getOutput===="+val);
let dataStr = String.fromCharCode.apply(null, val);
return dataStr;
}
export {
environment,
isIntNum,
......@@ -59,6 +38,4 @@ export {
afterAll,
it,
expect,
readFile,
executeRunCmd
};
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册