如何在Google存储桶中重命名对象? [英] How to rename an object in Google Storage bucket?

查看:151
本文介绍了如何在Google存储桶中重命名对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过API重命名Google存储桶中的对象?

How to rename an object in Google Storage bucket through the API?

另请参见尝试重命名Google Bucket对象时发生错误(Google错误?)

推荐答案

对象不能重命名.最好的办法是复制到新对象并删除原始对象.如果新对象和旧对象位于同一位置(例如,如果它们位于同一存储桶中,则为true),这将是仅元数据操作(无字节复制),因此速度很快.但是,由于这是两次操作,因此不是原子操作.

Objects can't be renamed. The best you can do is copy to a new object and delete the original. If the new and old object are the same location (which will be true if they're in the same bucket, for example) it will be a metadata-only (no byte copying) operation, and hence fast. However, since it's two operations it won't be atomic.

这篇关于如何在Google存储桶中重命名对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆