diff options
Diffstat (limited to 'web/static/client.mjs')
| -rw-r--r-- | web/static/client.mjs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/web/static/client.mjs b/web/static/client.mjs index 69f44d2..c012fc0 100644 --- a/web/static/client.mjs +++ b/web/static/client.mjs @@ -96,9 +96,10 @@ export class Client { if (live && !this.closed) await this.ask('clunk', 1); } } - readPath(path) { + readPath(path, metadataOnly = false) { return this.serial(() => this.withFile(path, async () => { const stat = JSON.parse(decoder.decode((await this.ask('stat', 1)).data)); + if (metadataOnly && !stat.directory) return { stat, entries: [], bytes: new Uint8Array(), stream: true }; const opened = await this.ask('open', 1, 0); const count = Math.min(this.wasm.max_read(), opened.number || Infinity); let offset = 0; |
