How to remove Google Cloud Storage empty folders in a hierarchical bucket - Stack Overflow

I am using a GCP Cloud Storage bucket with hierarchical 'virtual' folders.I create an object

I am using a GCP Cloud Storage bucket with hierarchical 'virtual' folders.

I create an object with a path (or name because there are no real folders) of:

bucket_name/path/to/file.txt

I then delete the object /path/to/file.txt from bucket_name and refresh the browser interface. I can see bucket_name and then drill down /path/to/ to an empty folder. I've refreshed the page but the prefix path still exists without an object.

Does anyone know how to clean these away. I have deleted all the objects in the bucket but I can still see the old directories. I know I can go into the Storage browser interface and delete them by hand, but is there a way to do this programatically? I have a clean up method that I call to delete objects that are not in use but I'm keen to avoid having a million empty virtual folders that I have to clean away by hand.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744816527a4595358.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信