You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Another idea I'm not too attached to but figured I'd throw it out. What about:
file.createReadStream({tail: 10})
This would override or be always overridden by start/end. Problems include introducing another parameter, parameters that void other parameters, but benefits are it's clear in its purpose.
I'm 👍 to end: -10 (the same way in CSS you can do right: -10px for example). Definitely would rather this than adding a new parameter... But you guys are the experts.
Activity
[-]Allow readonly only n tail bytes from a file[/-][+]Allow reading only n tail bytes from a file[/+]ryanseys commentedon Mar 3, 2015
Another idea I'm not too attached to but figured I'd throw it out. What about:
This would override or be always overridden by
start/end. Problems include introducing another parameter, parameters that void other parameters, but benefits are it's clear in its purpose.stephenplusplus commentedon Jul 1, 2015
How about just allowing:
and adding documentation to explain that's reading -10 tail bytes?
jgeewax commentedon Jul 1, 2015
I'm 👍 to
end: -10(the same way in CSS you can doright: -10pxfor example). Definitely would rather this than adding a new parameter... But you guys are the experts.stephenplusplus commentedon Jul 1, 2015
Cool cool. Let's try it out and if we find the community hates it, we can try again!
build: rename _toc to toc (#420)
chore(deps): update dependency sinon to v10 (#420)
chore(deps): update dependency sinon to v10 (#420)
chore(deps): update dependency sinon to v10 (#420)
26 remaining items
fix: update npm token used in publish script (#420)
chore(deps): update dependency typescript to ~3.5.0 (#420)
chore(deps): update dependency cpy-cli to v3 (#420)
chore: cleanup repo metadata and remove unused files (#420)
chore(deps): update dependency cpy-cli to v3 (#420)
chore(deps): update dependency typescript to ~3.5.0 (#420)
chore(deps): update dependency typescript to ~3.5.0 (#420)
fix: re-enable linting and formatting (#420)
chore: migrate code from googleapis/gcp-metadata (#53)
refactor(typescript): noImplicityAny for topic.ts and subscription.ts (…
refactor: drop dependency on pify (#420)
fix(deps): update dependency @google-cloud/promisify to ^0.4.0 (#420)
fix(deps): update dependency @google-cloud/promisify to ^0.4.0 (#420)
fix(deps): update dependency @google-cloud/promisify to ^0.4.0 (#420)
fix(deps): update dependency @google-cloud/promisify to ^0.4.0 (googl…