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

Add Directory property to GetBlobs #1

Open
kzu opened this issue Jun 23, 2017 · 0 comments
Open

Add Directory property to GetBlobs #1

kzu opened this issue Jun 23, 2017 · 0 comments

Comments

@kzu
Copy link

kzu commented Jun 23, 2017

When a given container has a large amount of blobs organized in subdirectories, enumerating all
with GetBlobs is impractical.

If the caller build script can determine the subdirectory to fetch, however, things might be way more
manageable.

This could be as simple as:

var dir = container.GetDirectoryReference("");
foreach (var subDir in Directory.Split('/', '\\'))
{
	dir = dir.GetDirectoryReference(subDir);
}

var blobs = dir.ListBlobs().Select(d => d.Uri.OriginalString).ToList().Dump();

(that's working code in a LINQPad query ;).

If I get some spare time, I'd like to send a PR. But putting it here so I don't forget, and maybe you get to do it before :)

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

1 participant