I (think I) understood the concept of S3 of being a key based storage, where the key is actually the path to the file. Thus there is no concept of folders. But how come, that it is possible to create empty folders in S3? Also, my impression is, that the empty folders exist only for a short period of time (a couple of hours) and then disappear automatically.
When a folder is created in the Amazon S3 Management Console, it actually creates a zero-length object with the name of the folder. This causes it to appear in the console.
If the object is deleted and there are no files using that path, then the folder will also disappear:
$ aws s3 ls s3://my-bucket
PRE foo/
$ aws s3 ls s3://my-bucket/foo/
2017-07-20 07:09:20 0
$ aws s3 rm s3://my-bucket/foo/
delete: s3://my-bucket/foo/
$ aws s3 ls s3://my-bucket
$
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With