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.