how to list the folder created by google storage web console?

184 views
Skip to first unread message

江云帆

unread,
Aug 10, 2010, 11:15:22 PM8/10/10
to gs-dis...@googlegroups.com
hi,there,
i have tried google storage's web console
and create a group of folders in my bucket
when i try

gsutil ls gs://mybucket/

found some object named    name_$folder$
i think this is the folder inode file
but i cant cat the content of these file
when i try

gsutil cat gs://mybucket/name_$folder$

if tell me

InvalidUriError: Attempt to get key for "gs://mybucket/name_$" failed. This probably indicates the URI is invalid..

so any explain or document to show?


--
welcom to gtalk me
http://hi.baidu.com/jyf1987

Mike Schwartz (Google Storage Team)

unread,
Aug 11, 2010, 11:01:20 AM8/11/10
to gs-dis...@googlegroups.com
Hi,

The Google Storage manager uses objects named $folder$ as place holders when you first create a folder, as a way to make the flat naming mechanism provided by buckets look more like a hierarchical file system. There actually is no such thing as a folder in Google Storage - objects can have path names containing slashes that make them look like they are part of a hierarchical file system but actually they are just string names. For example the name "gs://bucket/abc/def.txt" is really just an object called "abc/def.txt" inside the bucket "bucket"; there is no folder called "abc". The $folder$ name you saw was actually an object that Google Storage manager created to keep track of the fact that you created a folder until you have actually made objects with that folder in the path.

The fact that gsutil can't show you the contents of that $folder$ object is caused by a known bug.
- Mike
> --
> You received this message because you are subscribed to the Google Groups
> "Google Storage for Developers" group.
> To post to this group, send email to gs-dis...@googlegroups.com.
> To unsubscribe from this group, send email to
> gs-discussio...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/gs-discussion?hl=en.
>

江云帆

unread,
Aug 11, 2010, 9:11:48 PM8/11/10
to gs-dis...@googlegroups.com
i think if i store lots of file on a bucket, it will be useful while providing  sub folder
i dont want to wait for times to receive all objects name in the bucket

David Kocher

unread,
Sep 3, 2010, 1:37:04 PM9/3/10
to gs-dis...@googlegroups.com
I wonder why this naming convention has been adopted to implement this. It makes interoperability with other tools difficult. There are other methods to represent the placeholder that seem to make much more common sense, like

* Leave the name of the file as is and set a MIME type in the Content-Type metadata denoting a directory like "application/x-directory".
* Create a file with a "/" appended to the name. It will then appear in the list of common prefixes and marked as a folder for most tools on the market.

-David

Mike Schwartz (Google Storage Team)

unread,
Sep 4, 2010, 12:17:17 PM9/4/10
to gs-dis...@googlegroups.com
Thanks for the feedback. We have opened a tracking issue on this
- Mike

Clement Yuan

unread,
Aug 2, 2011, 8:08:43 AM8/2/11
to gs-dis...@googlegroups.com
you can use ereg to separate those folder. gsutil based on unix command.
Reply all
Reply to author
Forward
0 new messages