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

Deleting an "empty folder" object causes files under the same prefix to be deleted erroneously #190

Open
davidparks21 opened this issue Mar 31, 2021 · 0 comments

Comments

@davidparks21
Copy link

davidparks21 commented Mar 31, 2021

Reproduce this issue as follows (replace BUCKETNAME).

> touch tmp.txt
> s4cmd put tmp.txt "s3://BUCKETNAME/bugcheck/"    # create an empty directory marker
> s4cmd put tmp.txt s3://BUCKETNAME/bugcheck/file  # create any file under that path

# ls shows both an empty directory file and a file under that path
> s4cmd ls s3://BUCKETNAME/bugcheck
2021-03-31 19:41 0 s3://BUCKETNAME/bugcheck/
2021-03-31 19:41 0 s3://BUCKETNAME/bugcheck/file

# delete just the empty directory marker (no recursive options set), we DON'T want to delete `file`, but both are deleted
> s4cmd del "s3://BUCKETNAME/bugcheck/"
Delete s3://BUCKETNAME/bugcheck/
Delete s3://BUCKETNAME/bugcheck/file

In the example above only the object s3://BUCKETNAME/bugcheck/ should be deleted, but s3://BUCKETNAME/bugcheck/file gets deleted as well unexpectedly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant