Repository navigation
callback for bucket.getFiles doesn't return prefixes #491
Copy link
Copy link
Closed
Labels
🚨This issue needs some love.This issue needs some love.api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.triage meI really want to be triaged.I really want to be triaged.
Description
Activity
Related to #342
- addedapi: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.
on Apr 10, 2015 Thanks for catching this. The prefixes will be available from the apiResponse (note only will work on master, since #448 was merged):
bucket.getFiles({ /*...*/ }, function (err, files, nextQuery, apiResponse) { // apiResponse.prefixes })
- added a commit that references this issue
on Apr 21, 2015 - added a commit that references this issue
on Apr 21, 2015 We put a more helpful tip in the docs. If you feel we can do better, please re-open!
In the latest version
3.2.1prefixes can't be obtained because of the wrapping, the callback passed to thegetFilesfunction looks like this:cb:(err, results, nextQuery) => { if (err) { this.destroy(err); return; } this._nextQuery = nextQuery; if (this._resultsToSend !== Infinity) { results = results.splice(0, this._resultsToSend); this._resultsToSend -= results.length; } let more = true; for (const result of results) { if (this._ended) { break; } more = this.push(result); } const isFinished = !this._nextQuery || this._resultsToSend < 1; const madeMaxCalls = ++this._requestsMade >= this._maxApiCalls; if (isFinished || madeMaxCalls) { this.end(); } if (more && !this._ended) { setImmediate(() => this._read()); } this._reading = false; }So this would need a proper change, either a
getPrefixesfunction or a different type of response.- added🚨This issue needs some love.This issue needs some love.triage meI really want to be triaged.I really want to be triaged.
on Apr 6, 2020 23 remaining items
- added a commit that references this issue
on Feb 23, 2026 - added a commit that references this issue
on Feb 24, 2026 - added a commit that references this issue
on Feb 26, 2026 - added a commit that references this issue
on Feb 26, 2026 - added a commit that references this issue
on Mar 27, 2026
Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.triage meI really want to be triaged.I really want to be triaged.
From the docs;
storage > bucket.getFiles > query.delimiter
But then there is no reference anywhere to that "prefixes" array (?) that should contain the truncated objects.
This would be really useful if implemented, because as of today, there is not a simple way of making an object browser with folder hierarchy (like the storage explorer in the application console), which is able to list files and folders given a prefix (or inside a folder).