let promise = data_preferences.getPreferences(context,'mystore');
await promise.then((object) => {
preferences = object;
});
promise = preferences.get('index', 0);
await promise.then((data) => {
Test = data;
console.info("Succeeded in getting value of 'index'. Data: " + data);
});
if(Test != 1) {
fileio.mkdirSync(path1);
fileio.mkdirSync(path2);
fileio.mkdirSync(path3);
fileio.mkdirSync(path4);
let promise = preferences.put('index', 1);
promise.then(() => {
console.info("Succeeded in putting value of 'index'.");
});
promise = preferences.flush();
promise.then(() => {
console.info("Succeeded in flushing.");
});
}
fileio.openSync(path11, 0o100 | 0o2002, 0o664);
fileio.openSync(path22, 0o100 | 0o2002, 0o664);
fileio.openSync(path33, 0o100 | 0o2002, 0o664);
fileio.openSync(path44, 0o100 | 0o2002, 0o664);
}
build(){
build(){
Column(){
Column(){
Row() {
Row() {
...
@@ -118,7 +165,7 @@ struct IndexPage {
...
@@ -118,7 +165,7 @@ struct IndexPage {
url: item.uri,
url: item.uri,
})
})
let dateTimeUtil = new DateTimeUtil();
let dateTimeUtil = new DateTimeUtil();
let time = `${dateTimeUtil.getFullYear()}-${dateTimeUtil.getMonth()}-${dateTimeUtil.getDate()} ${dateTimeUtil.getHour()}:${dateTimeUtil.getMinute()}:${dateTimeUtil.getSecond()}`;
let time = `${dateTimeUtil.getFullYear()}-${dateTimeUtil.getMonth()}-${dateTimeUtil.getDay()} ${dateTimeUtil.getHour()}:${dateTimeUtil.getMinute()}:${dateTimeUtil.getSecond()}`;
let TimePath = path + "/Time.txt";
let TimePath = path + "/Time.txt";
let OP = fileio.openSync(TimePath, 0o100 | 0o2002, 0o664);
let OP = fileio.openSync(TimePath, 0o100 | 0o2002, 0o664);
let endtime = `${dateTimeUtil.getFullYear()}-${dateTimeUtil.getMonth()}-${dateTimeUtil.getDate()} ${dateTimeUtil.getHour()}:${dateTimeUtil.getMinute()}:${dateTimeUtil.getSecond()}`;
let endtime = `${dateTimeUtil.getFullYear()}-${dateTimeUtil.getMonth()}-${dateTimeUtil.getDay()} ${dateTimeUtil.getHour()}:${dateTimeUtil.getMinute()}:${dateTimeUtil.getSecond()}`;
let TimePath = path + "/Time.txt";
let fd = fileio.openSync(TimePath, 0o100 | 0o2002, 0o664);
let fd = fileio.openSync(TimePath, 0o100 | 0o2002, 0o664);
let buf = new ArrayBuffer(40960);
let buf = new ArrayBuffer(40960);
fileio.readSync(fd,buf);
fileio.readSync(fd,buf);
...
@@ -148,8 +213,6 @@ struct IndexPage {
...
@@ -148,8 +213,6 @@ struct IndexPage {
let Index = StartTime.indexOf(';');
let Index = StartTime.indexOf(';');
let starttime = StartTime.substring(0,Index);
let starttime = StartTime.substring(0,Index);
let path11 = path1 + '/ArkUI.txt';
let path22 = path2 + '/MediaLibrary.txt';
let OP1 = fileio.openSync(path11, 0o100 | 0o2002, 0o664);
let OP1 = fileio.openSync(path11, 0o100 | 0o2002, 0o664);