let filePath = pathDir + "/test.txt";
let file = fs.openSync(filePath, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE);
let writeLen = fs.writeSync(file.fd, "hello, world");
console.info("write data to file succeed and size is:" + writeLen);
fs.closeSync(file);
https://developer.huawei.com/consumer/cn/doc/harmonyos-refere...