Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list_blobs doesn't work at all when delimiter is specified #41

Closed
makhdumi opened this issue Aug 19, 2016 · 4 comments
Closed

list_blobs doesn't work at all when delimiter is specified #41

makhdumi opened this issue Aug 19, 2016 · 4 comments

Comments

@makhdumi
Copy link
Contributor

makhdumi commented Aug 19, 2016

When list_blobs is called with a delimiter, e.g. /, it does not return any results despite the server returning a valid response.

This part in blob_enumeration_results_from_xml doesn't check for (xml > "Blobs") > "BlobPrefix" which is what the server returns when delimiter is specified.

If this is actually an issue, it's very surprising since this use case of list_blobs is extremely common and even the default in other client libraries. It's needed when trying to traverse a pseudo-directory structure in blob storage, otherwise, results are returned "flat" or "recursive," and with thousands of blobs, it's not usable.

See here the .NET client, where it uses a delimiter (/) by default (useFlatBlobListing is false by default).

I would submit a pull request (after signing the CLA) but don't know how you want the results of this returned, given that the results don't represent actual Blobs, just prefixes.

@makhdumi
Copy link
Contributor Author

makhdumi commented Aug 19, 2016

Here is a quick and dirty fix. Not production code - but the tests should demonstrate the issue.

In the other clients, there is a super class which Blobs (and then BlockBlobs, AppendBlobs, PageBlobs) and BlobPrefixes share.

makhdumi@ac45844

@yaxia
Copy link
Member

yaxia commented Aug 23, 2016

@makhdumi Thanks for raising the issue. If you are going to submit a fix, we expect the result is still an array. This array can hold two kinds of objects, one is Azure::Storage::Blob, the other one is a string whose value is the prefix value.

@makhdumi
Copy link
Contributor Author

@yaxia I've submitted pull request with the fix, #42

@vinjiang
Copy link
Member

Thanks for your contribution, it's now in latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants