Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit a7309ac

Browse files
committed
revert changes in samples/snippets/storage_list_files_with_prefix.py
1 parent 0bf17c7 commit a7309ac

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

samples/snippets/storage_list_files_with_prefix.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ def list_blobs_with_prefix(bucket_name, prefix, delimiter=None):
4646
that lists the "subfolders" under `a/`:
4747
4848
a/b/
49+
50+
51+
Note: If you only want to list prefixes a/b/ and don't want to iterate over
52+
blobs, you can do
53+
54+
```
55+
for page in blobs.pages:
56+
print(page.prefixes)
57+
```
4958
"""
5059

5160
storage_client = storage.Client()
@@ -69,4 +78,6 @@ def list_blobs_with_prefix(bucket_name, prefix, delimiter=None):
6978
# [END storage_list_files_with_prefix]
7079

7180
if __name__ == "__main__":
72-
list_blobs_with_prefix(bucket_name=sys.argv[1], prefix=sys.argv[2])
81+
list_blobs_with_prefix(
82+
bucket_name=sys.argv[1], prefix=sys.argv[2], delimiter=sys.argv[3]
83+
)

0 commit comments

Comments
 (0)