mirror of
https://github.com/lxsang/antos-frontend.git
synced 2024-11-08 05:58:22 +01:00
robusify VFS mem file handling
This commit is contained in:
parent
5734ce8ca9
commit
81d78aa8e5
12807
d.ts/antos.d.ts
vendored
12807
d.ts/antos.d.ts
vendored
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -1438,6 +1438,7 @@ namespace OS {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Read the file meta-data
|
||||
*
|
||||
@ -1453,6 +1454,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
|
||||
*
|
||||
@ -1463,6 +1474,13 @@ namespace OS {
|
||||
*/
|
||||
protected _rd(t: string): Promise<any> {
|
||||
return new Promise((resolve, reject) => {
|
||||
// read dir
|
||||
if (this.info.type === "dir") {
|
||||
return resolve({
|
||||
result: [],
|
||||
error: false,
|
||||
});
|
||||
}
|
||||
return resolve(this.cache);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user