How to create a folder using gsutil?

4,207 views
Skip to first unread message

David Lee

unread,
Nov 29, 2010, 11:06:20 PM11/29/10
to Google Storage for Developers
gsutil a good tool ,i can list buckets and upload objects using it.
but i can't find commands about create foloder on my bucket.
how to do it?
someone can tell me? thanks!

Guy

unread,
Nov 30, 2010, 10:24:10 AM11/30/10
to Google Storage for Developers
It is easy to achieve using the gsutil:

$ gsutil ls gs://destinations
gs://destination/places_$folder$

I still didn't manage to find out how to do it using their REST API,
though.

Guy

unread,
Nov 30, 2010, 6:03:01 AM11/30/10
to Google Storage for Developers
gs://destination/places_$folder$

just that. however, I still don't know how to do it using the API.

On Nov 30, 4:06 am, David Lee <lijinquan...@gmail.com> wrote:

Ken Stillson

unread,
Nov 30, 2010, 11:37:42 PM11/30/10
to Google Storage for Developers
From my understanding, there's really no such thing as a folder as a
separate entity- it's not a real file-system. You create a file
object with a pathname that happens to contain "/" characters, and the
virtual directory tree is constructed by splitting the pathname string
at the "/" characters. Bottom line- the system only contains files,
not directories, so just create the files with the full pathnames you
want, and the appropriate directory structure will magically appear.
If you want to pre-populate a directory tree, just create a dummy file
in each directory you want to exist. At least I think that's the way
it works. :)
Reply all
Reply to author
Forward
0 new messages