Google GSutil create folder

后端 未结 3 665
情书的邮戳
情书的邮戳 2021-01-08 00:23

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 er

3条回答
  •  既然无缘
    2021-01-08 00:43

    You cannot create folders with gsutils as gsutils does not support it (workaround see below).

    However, it is supported via:

    • UI in browser
    • write your own GCS client (we have written our own custom client which can create folders)

    So even if google has a flat name space structure as the other answer correctly points out, it still has the possibility to create single folders as individual objects. Unfortunately gsutils does not exposed this.

    (Ugly) workaround with gsutils: Add a dummy file into a folder and upload this dummy file - but the folder will be gone once you delete this file, unless other files in that folder are present.

提交回复
热议问题