mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2026-04-25 13:26:00 +03:00
[GH-ISSUE #225] Cannot mount directory which haven't been explicitly created. #122
Labels
No labels
bug
bug
dataloss
duplicate
enhancement
feature request
help wanted
invalid
need info
performance
pull-request
question
question
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/s3fs-fuse#122
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Doerge on GitHub (Aug 11, 2015).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/225
I'm not sure if this is supposed to work or not but here goes:
If 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:
It 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.
The 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?
Also thanks for a great project!
Best,
Aske
@ggtakec commented on GitHub (Aug 12, 2015):
Although I have not able to test for this, can you try the following thing?
please try to change “mydirectory” directory name to “mydirectory/” and retry to mount.
Maybe then, your directory name does not have “/“ at the end of name.
Because s3fs is operating on the assumption that there is it.
If your result is success, I fix the codes for this case which the directory does not have “/“ at end of name.
Thanks in advance for your help.
Takeshi
@Doerge commented on GitHub (Aug 13, 2015):
Sorry I was a bit unclear. Here is a small python example that will hopefully make it clearer:
I think you should use a request that checks for keys with the prefix, and not if the directory exists as a key.
Perhaps http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGET.html could be used with the prefix parameter, and maxkeys=1?
Thanks for your help.
Aske
@osterman commented on GitHub (Jun 23, 2016):
Related to this, I would like the option to create the folder in the bucket if it does not exist. Otherwise this needs to be instrumented outside of s3fs (either by hand or using some other tool / library), when it seems like a trivial thing for s3fs to do.
@sqlbot commented on GitHub (Jun 23, 2016):
From the perspective of how the S3 API and console work, what s3fs should do is not care if the root folder placeholder is missing.
This would be consistent with the console behavior -- the console doesn't actually "need" it. If you create the folder
fooin the console, you get a visible folder, and an empty object namedfoo/in the bucket if you list the keys through the API. You can then uploadbar.txt"into" the (imaginary) folder, and you have an object namedfoo/bar.txt. Or, uploading the objectfoo/bar.txtthrough the API would have the same result -- however, with an empty bucket, creating the objectfoo/bar.txtthrough the API also results in that folder being visible in the console, even though nofoo/object actually exists in the bucket.It seems to me like s3fs should have no real need for the
foo/object to exist, since it's not actually any kind of container, and listing objects with prefixfoo/and delimiter/will return the same empty result whether thefoo/object is present or not.The folder placeholder shouldn't be "needed" in any meaningful sense, since it is reasonable to infer that that it's permissions are something sane like
drwxrwx--- root rootif the object is absent (or present with no metadata). Usingchmodorchownon the mount point should createfoo/when executed, so the permissions can be set on the metadata, just as it should do for a subdirectory further down in the bucket that was implicitly "manifested" (since no placeholder is actually created in that case) by uploading objects through the API directly using a matching prefix.@ggtakec commented on GitHub (Jun 26, 2016):
@Doerge
I'm sorry, I had mistaken the meaning of your question.
Now, s3fs can not use mount point on the folder(object in S3) that does not exist.
The "mydirectory/test.txt" object which is made on S3-console by you is only one "mydirectory/test.txt" object, it does not make "mydirectory/"(or "mydirectory") object in S3.
Then s3fs can not get success to check the mount point "/mydirectory", and failed to mount.
But s3fs can make bucket(and sub directory if it is specified) at start with "createbucket" option.
So you can run s3fs following (only once):
Please try it.(@osterman too)
Thanks in advance for your assistance.
@sqlbot Thanks for your help.
Regards,