{"action":"created","issue":{"url":"https://api.github.com/repos/s3fs-fuse/s3fs-fuse/issues/225","labels_url":"https://api.github.com/repos/s3fs-fuse/s3fs-fuse/issues/225/labels{/name}","comments_url":"https://api.github.com/repos/s3fs-fuse/s3fs-fuse/issues/225/comments","events_url":"https://api.github.com/repos/s3fs-fuse/s3fs-fuse/issues/225/events","html_url":"https://github.com/s3fs-fuse/s3fs-fuse/issues/225","id":100261332,"number":225,"title":"Cannot mount directory which haven't been explicitly created.","user":{"login":"Doerge","id":3216279,"avatar_url":"https://avatars.githubusercontent.com/u/3216279?v=3","gravatar_id":"","url":"https://api.github.com/users/Doerge","html_url":"https://github.com/Doerge","followers_url":"https://api.github.com/users/Doerge/followers","following_url":"https://api.github.com/users/Doerge/following{/other_user}","gists_url":"https://api.github.com/users/Doerge/gists{/gist_id}","starred_url":"https://api.github.com/users/Doerge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Doerge/subscriptions","organizations_url":"https://api.github.com/users/Doerge/orgs","repos_url":"https://api.github.com/users/Doerge/repos","events_url":"https://api.github.com/users/Doerge/events{/privacy}","received_events_url":"https://api.github.com/users/Doerge/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-11T08:52:42Z","updated_at":"2015-08-13T08:46:35Z","closed_at":null,"body":"I'm not sure if this is supposed to work or not but here goes:\r\n\r\nIf you create a key with slashes in the name e.g. \"mydirectory/test.txt\", without having explicitly created the directory \"mydirectory\" as an empty key, s3fs-fuse cannot mount it:\r\n\r\n    > /usr/bin/s3fs mybucket:/mydirectory /mymountdir\r\n        set_moutpoint_attribute(4055): PROC(uid=0, gid=0) - MountPoint(uid=0, gid=0, mode=40755)\r\n    s3fs_init(3239): init\r\n    s3fs_check_service(3598): check services.\r\n        CheckBucket(2537): check a bucket.\r\n        insertV4Headers(1973): computing signature [GET] [/mydirectory/] [] []\r\n        url_to_host(99): url is http://s3.amazonaws.com\r\n        RequestPerform(1631): connecting to URL http://mybucket.s3.amazonaws.com/mydirectory/\r\n        RequestPerform(1670): HTTP response code 404 was returned, returning ENOENT\r\n    CheckBucket(2575): Check bucket failed, S3 response: <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n    <Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>mydirectory/</Key><RequestId>47B15E4ACD932636</RequestId><HostId>3XJdNPWR2Z0/1mKzfmmm2qxv+ubLOdQHl6zxWW/1oMFlnpmtDRV1EvZKF1LlttdqjxoyTghMYl0=</HostId></Error>\r\n    s3fs: bucket not found\r\n\r\nIt makes sense, because the key mydirectory doesn't exist. However it is shown as a directory inside the s3-console so I sort of expected them to behave the same way in s3fs-fuse.\r\n\r\nThe work-around is very simple: Create the directoy as an empty key. I just didn't know it was supposed to be that way. Perhaps this should be added to the FAQ or to the Limitations section?\r\n\r\nAlso thanks for a great project!\r\nBest,\r\nAske"},"comment":{"url":"https://api.github.com/repos/s3fs-fuse/s3fs-fuse/issues/comments/130578204","html_url":"https://github.com/s3fs-fuse/s3fs-fuse/issues/225#issuecomment-130578204","issue_url":"https://api.github.com/repos/s3fs-fuse/s3fs-fuse/issues/225","id":130578204,"user":{"login":"Doerge","id":3216279,"avatar_url":"https://avatars.githubusercontent.com/u/3216279?v=3","gravatar_id":"","url":"https://api.github.com/users/Doerge","html_url":"https://github.com/Doerge","followers_url":"https://api.github.com/users/Doerge/followers","following_url":"https://api.github.com/users/Doerge/following{/other_user}","gists_url":"https://api.github.com/users/Doerge/gists{/gist_id}","starred_url":"https://api.github.com/users/Doerge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Doerge/subscriptions","organizations_url":"https://api.github.com/users/Doerge/orgs","repos_url":"https://api.github.com/users/Doerge/repos","events_url":"https://api.github.com/users/Doerge/events{/privacy}","received_events_url":"https://api.github.com/users/Doerge/received_events","type":"User","site_admin":false},"created_at":"2015-08-13T08:46:35Z","updated_at":"2015-08-13T08:46:35Z","body":"Sorry I was a bit unclear. Here is a small python example that will hopefully make it clearer:\r\n\r\n    import boto\r\n    s3 = boto.connect_s3(<key_id>, <key_secret>)\r\n    buck = s3.create_bucket('mybucketname')\r\n\r\n    k = buck.new_key('mydirectory/test.txt')\r\n    k.set_contents_from_string('foobarbaz')\r\n    k.close()\r\n\r\n    k = buck.get_key('mydirectory/test.txt')\r\n    assert k != None\r\n\r\n    k = buck.get_key('mydirectory/')\r\n    assert k == None\r\n    k = buck.get_key('/mydirectory/')\r\n    assert k == None\r\n    k = buck.get_key('/mydirectory')\r\n    assert k == None\r\n    k = buck.get_key('mydirectory')\r\n    assert k == None\r\n\r\n    # Possible solution? Use prefix and check if it is empty?\r\n    ks = buck.get_all_keys(prefix='mydirectory/')\r\n    assert len(ks) > 0\r\n\r\nI think you should use a request that checks for keys with the prefix, and not if the directory exists as a key. \r\nPerhaps http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGET.html could be used with the prefix parameter, and maxkeys=1?\r\n\r\nThanks for your help.\r\nAske"}}