mirror of
https://github.com/lxsang/antos-frontend.git
synced 2024-12-26 17:38:20 +01:00
robusify VFS mem file handling
This commit is contained in:
parent
5734ce8ca9
commit
81d78aa8e5
12941
d.ts/antos.d.ts
vendored
12941
d.ts/antos.d.ts
vendored
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -1437,7 +1437,8 @@ namespace OS {
|
|||||||
type: "file",
|
type: "file",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read the file meta-data
|
* Read the file meta-data
|
||||||
*
|
*
|
||||||
@ -1452,6 +1453,16 @@ namespace OS {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the parent file handle of the current file
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
parent(): BaseFileHandle {
|
||||||
|
const handle = super.parent();
|
||||||
|
handle.info.type = "dir";
|
||||||
|
return handle;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read file content stored in the file cached
|
* Read file content stored in the file cached
|
||||||
@ -1463,6 +1474,13 @@ namespace OS {
|
|||||||
*/
|
*/
|
||||||
protected _rd(t: string): Promise<any> {
|
protected _rd(t: string): Promise<any> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
// read dir
|
||||||
|
if (this.info.type === "dir") {
|
||||||
|
return resolve({
|
||||||
|
result: [],
|
||||||
|
error: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
return resolve(this.cache);
|
return resolve(this.cache);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user