DigitalGlobe / gbdxtools

(Deprecated) Python SDK for using GBDX
MIT License
74 stars 57 forks source link

gbdx.s3.delete is too greedy #784

Closed drwelby closed 4 years ago

drwelby commented 4 years ago

Current behavior doesn't use slash delimiters with the prefix, so s3.delete('dir') will match to dir/, 'dir_1/, and anything else starting withdir*`.

Need to add a slash delimiter and remove code that strips trailing slashes at a minimum.

michaelconnor00 commented 4 years ago

So the expected behaviour of s3.delete('dir)should match namespacesdir, wheres3.delete('dir/')should match namespacesdir/? Where currently both would matchdir*`.

drwelby commented 4 years ago

Yes, we basically need to implement: https://docs.aws.amazon.com/AmazonS3/latest/dev/ListingKeysHierarchy.html