Google GSutil 创建文件夹 [英] Google GSutil create folder
问题描述
如何使用 gsutil 命令在谷歌云存储的存储桶中创建一个新文件夹?
How can u create a new folder inside a bucket in google cloud storage using the gsutil command?
我尝试在创建存储桶时使用相同的命令,但仍然出错
I tried using the same command in creating bucket but still got an error
gsutil mb -l us-east1 gs://my-awesome-bucket/new_folder/
谢谢!
推荐答案
目录的概念在 Google Cloud Storage 中是抽象的.来自文档(子目录的工作原理):
The concept of directory is abstract in Google Cloud Storage. From the docs (How Subdirectories Work) :
gsutil 在 Google Cloud Storage 服务支持的平面"名称空间之上提供了分层文件树的错觉.对于该服务,对象 gs://your-bucket/abc/def.txt 只是一个名称中碰巧包含/"字符的对象.没有abc"目录;只是一个具有给定名称的对象.
gsutil provides the illusion of a hierarchical file tree atop the "flat" name space supported by the Google Cloud Storage service. To the service, the object gs://your-bucket/abc/def.txt is just an object that happens to have "/" characters in its name. There is no "abc" directory; just a single object with the given name.
因此您无法像在传统文件系统中那样创建"目录.
So you cannot "create" a directory like in a traditional File System.
这篇关于Google GSutil 创建文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!