Read part of a file, for chunked reads and resumed downloads.
readRange(path: string, options: ReadRangeOptions): Promise<FileChunk>| Name | Type | Description |
|---|---|---|
path* | string | File path to read. |
options* | ReadRangeOptions | The byte range, plus optional |
const head = await sandbox.readRange("/big.bin", { start: 0, end: 1023 });
const next = await sandbox.readRange("/big.bin", {
start: head.end ?? 1024,
ifRange: head.etag,
});