Google GSutil创建文件夹 [英] Google GSutil create folder

查看:230
本文介绍了Google GSutil创建文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用gsutil命令在Google云存储的存储桶中创建新文件夹?

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屋!

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