Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Folders not showing up in Bucket storage

Tags:

So my problem is that a have a few files not showing up in gcsfuse when mounted. I see them in the online console and if I 'ls' with gsutils. Also, if If I manually create the folder in the bucket, i then can see the files inside it, but I need to create it first. Any suggestions?

gs://mybucket/ dir1/ ok.txt dir2 lafu.txt

If I mount mybucket with gcsfuse and do 'ls' it only returns dir1/ok.txt. Then I'll create the folder dir2 inside dir1 at the root of the mounting point, and suddenly 'lafu.txt' shows up.

like image 564
cupcakearmy Avatar asked Jul 11 '16 15:07

cupcakearmy


People also ask

How do I upload a folder to GCS bucket?

In the Google Cloud console, go to the Cloud Storage Buckets page. Navigate to the bucket. Click on Create folder to create an empty new folder, or Upload folder to upload an existing folder.

What is Gcsfuse?

gcsfuse is open source software, released under the Apache license. It is distributed as-is, without warranties or conditions of any kind. For support, visit Server Fault. Tag your questions with gcsfuse and google-cloud-platform , and make sure to look at previous questions and answers before asking a new one.


2 Answers

By default, gcsfuse won't show a directory "implicitly" defined by a file with a slash in its name. For example if your bucket contains an object named dir/foo.txt, you won't be able to find it unless there is also an object nameddir/.

You can work around this by setting the --implicit-dirs flag, but there are good reasons why this is not the default. See the documentation for more information.

like image 111
jacobsa Avatar answered Oct 06 '22 22:10

jacobsa


Google Cloud Storage doesn't have folders. The various interfaces use different tricks to pretend that folders exist, but ultimately there's just an object whose name contains a bunch of slashes. For example, "pictures/january/0001.jpg" is the full name of a single object.

If you need to be sure that a "folder" exists, put an object inside it.

like image 28
Brandon Yarbrough Avatar answered Oct 06 '22 22:10

Brandon Yarbrough