更新时间:2023-11-27 09:11:10
如果您错过了它……S3中没有文件夹.
In case you've missed it... there are no folders in S3.
对象/pics/funny/cat.jpg
是不是的文件,而在另一个名为pics
的文件夹中的funny
文件夹中的cat.jpg
文件.
The object /pics/funny/cat.jpg
is not a file called cat.jpg
inside a folder called funny
inside another folder called pics
.
实际上,它是一个具有18个字符的名称的文件:pics/funny/cat.jpg
.控制台中显示的层次结构在很大程度上是为了方便人使用,并且在控制台中创建新文件夹的能力也是一种幻想.
In fact, it is a file with an 18-character name: pics/funny/cat.jpg
. The hierarchy shown in the console is largely for human convenience, and the ability to create new folders in the console is an illusion, also.
因此,是的,重命名文件夹"实际上意味着在文件夹"中为每个对象创建一个新副本,并更改对象名称以使其看起来像在路径中一样.
So, yes, renaming a "folder" actually means making a new copy of each object in the "folder," with a change to the object names to look like their are in the path.
这可以通过PUT/COPY
请求(每1000个$ 0.005,取决于区域)来完成,然后再执行旧对象的DELETE
请求(免费).没有相应的GET
请求,因为PUT/COPY
是S3内部的原子操作,因此可以避免实际下载和重新上传数据.
This can be done with a PUT/COPY
request ($0.005 per 1000 depending on the region) followed by a DELETE
request of the old object (free). There is no corresponding GET
request, because PUT/COPY
is an atomic operation inside S3, so actually downloading and re-uploading the data is avoided.