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

How to delete an empty folder? #2520

Open
jezaman opened this issue Sep 16, 2024 · 0 comments
Open

How to delete an empty folder? #2520

jezaman opened this issue Sep 16, 2024 · 0 comments
Labels
api: storage Issues related to the googleapis/nodejs-storage API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.

Comments

@jezaman
Copy link

jezaman commented Sep 16, 2024

Hello,

I have a setup where inside my bucket, i organise files based on project
So files are stored as {projectUUID}/{filename}

How do i delete the actual empty folder?
I found that i can use deleteFiles to delete the files inside the folder
await bucket.deleteFiles({
prefix: ${project}/,
});

But this doesn't delete the folder. I tried doing a manual delete of the folder path afterwards but that doesn't seem to work.
I tried removing the trailing '/' but that didn't have an effect either.

I really think this repo could use some basic examples. There is so many super complex examples already there, but there is not a basic example of "Delete multiple files" or a "Delete a folder".

And yes i know technically there are no folders inside the bucket.

@jezaman jezaman added priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue. labels Sep 16, 2024
@jezaman jezaman changed the title How to delete an empty folder>? How to delete an empty folder? Sep 16, 2024
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/nodejs-storage API. label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/nodejs-storage API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

1 participant