GoogleCloudPlatform / appengine-gcs-client

App Engine-Cloud Storage custom client library
Apache License 2.0
124 stars 112 forks source link

Is there any ways to delete GCS directory in Python ? #79

Closed taichi-jp closed 5 years ago

taichi-jp commented 5 years ago

I know cloudstorage.delete(filename) deletes a file, but I want delete a directory and all the files in it like cloudstorage.delete(dir) . Is there any ways to do this?

frankyn commented 5 years ago

Hi @taichi-jp,

GCS doesn't behave like a filesystem and is a flat namespace similar to a key value pair. Directories/paths are simulated in the GCS browser.

In order to delete objects that have the same prefix or path, a delete request must be made per object in a bucket.

taichi-jp commented 5 years ago

Thank you!