Skip to content

Allow reading only n tail bytes from a file #420

Closed
@stephenplusplus

Description

Carrying on from #415, a user can specify a start and end range to read from a remote file. The JSON API also allows reading n tail bytes from a file, e.g. range=-100 would be the last 100 bytes. Our API currently looks like:

file.createReadStream({ start: 0, end: 10 })

We could allow specifying a range in another way:

file.createReadStream({ range: "0-10" })

Which would open the doors for:

file.createReadStream({ range: "-100" })

Definitely open to other ideas of how we can support ranges of both types: "start and end" and "end offset".

Note: start and end was added to match the native fs module's createReadStream's arguments, which behaves the same was currently as ours.

Metadata

Labels

🚨This issue needs some love.api: storageIssues related to the Cloud Storage API.triage meI really want to be triaged.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions