Search code examples
google-cloud-storagebucketgcsfuse

Folders not showing up in Bucket storage


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.


Solution

  • 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.