提交 969e580e 编写于 作者: H hu0475

修改storage子系统fs模块的代码

Signed-off-by: Nhu0475 <huyanqiang5@huawei.com>
上级 2842f7d7
......@@ -15,7 +15,6 @@
import fileIO from "@ohos.file.fs";
import util from "@ohos.util";
//import featureAbility from '@ohos.ability.featureAbility';
export const FILE_CONTENT = "hello world";
......@@ -35,24 +34,6 @@ export function prepareFile(fpath, content) {
}
}
export function prepare200MFile(fpath) {
try {
let file = fileIO.openSync(fpath, fileIO.OpenMode.CREATE | fileIO.OpenMode.READ_WRITE);
fileIO.truncateSync(file.fd);
let bf = new ArrayBuffer(1024 * 1024 * 20);
for (let i = 0; i < 10; i++) {
let position = bf.byteLength * i;
let writeLen = fileIO.writeSync(file.fd, bf, { offset: 0, length: bf.byteLength, position: position, encoding: "utf-8" });
}
fileIO.fsyncSync(file.fd);
fileIO.closeSync(file);
return true;
} catch (e) {
console.log("Failed to prepare200MFile for " + e);
return false;
}
}
export async function nextFileName(testName) {
let context = globalThis.abilityContext;
let data = context.cacheDir;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册