From c2fd3f4da55da889923b21c314ee78aecfb12f75 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 26 Sep 2021 22:31:40 -0700 Subject: [PATCH] Updated Amazon S3 API (markdown) --- Amazon-S3-API.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Amazon-S3-API.md b/Amazon-S3-API.md index 1faeb25..e76b8a7 100644 --- a/Amazon-S3-API.md +++ b/Amazon-S3-API.md @@ -75,8 +75,15 @@ Not included: | DeleteObject deletes a folder| Yes | No | | same path for both a file and a folder| No | Yes | -By default, `weed s3` will automatically remove empty folders, to be consistent with AWS S3. -You can use `weed s3 -allowEmptyFolder` to toggle this behavior. +## Empty folders + +SeaweedFS has directories while AWS S3 only has objects with "fake" directories. In AWS S3, if the last file is deleted in a directory, the directory will disappear also. + +To be consistent with AWS S3, SeaweedFS tries to skip empty folders while listing. You can use `weed s3 -allowEmptyFolder` to toggle this behavior. + +This is not so ideal. Another approach is to list current directory when deleting a file, which will slow down quite a bit especially when deleting multiple files. SeaweedFS did not take this approach. + +The last approach, which is most efficient, is to maintain counters for each folder, and drop the folder as soon as it becomes empty. This is implemented in [[Cloud Monitoring]]. # Authentication By default, the access key and secret key to access `weed s3` is not authenticated. To enable credential based access, you can choose static or dynamic configuration: