GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — callback for bucket.getFiles doesn't return prefixes · Issue #491 · googleapis/google-cloud-node

callback for bucket.getFiles doesn't return prefixes #491

New issue
Copy link
New issue
Copy link
Closed
Closed
callback for bucket.getFiles doesn't return prefixes#491
Copy link
Assignees
stephenplusplus
Labels
🚨This issue needs some love.api: storageIssues related to the Cloud Storage API.triage meI really want to be triaged.

Description

@javorosas
javorosas
opened on Apr 10, 2015
Issue body actions

From the docs;

storage > bucket.getFiles > query.delimiter

[...] Objects whose names, aside from the prefix, contain delimiter will have their name truncated after the delimiter, returned in prefixes.

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).

Activity

Next
  1. ryanseys commented on Apr 10, 2015

    @ryanseys
    ryanseys
    on Apr 10, 2015
    Contributor
    More actions

    Related to #342

  2. ryanseys
    added
    api: storageIssues related to the Cloud Storage API.
    on Apr 10, 2015
  3. stephenplusplus commented on Apr 21, 2015

    @stephenplusplus
    stephenplusplus
    on Apr 21, 2015
    Contributor
    More actions

    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
    })
  4. stephenplusplus
    added a commit that references this issue on Apr 21, 2015

    storage: docs for prefixes - googleapis#491

    e376518
  5. ryanseys
    added a commit that references this issue on Apr 21, 2015

    Merge pull request #506 from stephenplusplus/spp--storage-491

    b094aa2
  6. stephenplusplus commented on Apr 21, 2015

    @stephenplusplus
    stephenplusplus
    on Apr 21, 2015
    Contributor
    More actions

    We put a more helpful tip in the docs. If you feel we can do better, please re-open!

  7. stephenplusplus
    closed this as completedon Apr 21, 2015
  8. conet commented on Sep 9, 2019

    @conet
    conet
    on Sep 9, 2019
    More actions

    In the latest version 3.2.1 prefixes can't be obtained because of the wrapping, the callback passed to the getFiles function 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 getPrefixes function or a different type of response.

  9. yoshi-automation
    added
    🚨This issue needs some love.
    triage meI really want to be triaged.
    on Apr 6, 2020
  10. JustinBeckwith
    assigned
    stephenplusplus
    on Feb 1, 2021
  11. chingor13
    added 3 commits that reference this issue on Aug 22, 2022

    feat: add Cloud Asset List API, add access time as condition context …

    b55c6af

    feat: add Cloud Asset List API, add access time as condition context …

    1ff0900

    feat: add Cloud Asset List API, add access time as condition context …

    17e1afc
  12. sofisl
    added a commit that references this issue on Sep 15, 2022

    chore: release 2.2.3 (#491)

    4ea89c3
  13. 23 remaining items

  14. sofisl
    added 3 commits that reference this issue on Jan 27, 2026

    chore: retry npm install in system test when the command hangs (#491)

    ef21683

    chore: retry npm install in system test when the command hangs (#491)

    fdac994

    chore: retry npm install in system test when the command hangs (#491)

    a608e70
  15. GautamSharda
    added 5 commits that reference this issue on Feb 2, 2026

    fix: apache license URL (#468) (#491)

    5433791

    chore: release 4.0.0 (#496)

    6bb066b

    fix: apache license URL (#468) (#491)

    0b00530

    chore: release 4.0.0 (#496)

    f165343

    chore: update CODEOWNERS (#491)

    e895436
  16. GautamSharda
    added a commit that references this issue on Feb 23, 2026

    chore: update CODEOWNERS (#491)

    8c7e278
  17. sofisl
    added a commit that references this issue on Feb 24, 2026

    chore: update nyc and eslint configs (#491)

    867c29d
  18. GautamSharda
    added a commit that references this issue on Feb 26, 2026

    chore: update CODEOWNERS (#491)

    cd2001c
  19. sofisl
    added a commit that references this issue on Feb 26, 2026

    build: check broken links in generated docs (#491)

    ed89a70
  20. GautamSharda
    added 2 commits that reference this issue on Mar 5, 2026

    refactor: drop dependency on lodash.merge and update links (#491)

    37ba2cd

    Release @google-cloud/pubsub v0.25.0 (#491)

    519e7c3
  21. feywind
    added a commit that references this issue on Mar 27, 2026

    Release @google-cloud/pubsub v0.25.0 (#491)

    2971b76
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @stephenplusplus
    stephenplusplus

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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.