New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
localfs: add link/symlink/islink methods #1059
Conversation
Do I remember that there was a plan to implement this kind of thing in a filesystem-specific
No, I think links are implemented on too few backends. |
The proposed |
@martindurant Saugat is right, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting for @martindurant final comments on this.
@efiop @martindurant, any thoughts on API namings? |
I am happy to follow the names in Before merging, any thoughts on more adding options for following symbolic links or not? Normally, I feel that |
Naming makes sense to me. This is universal enough and in the spirit of FUSE/syscalls/etc. The only one that is a bit special is One thing that worries me here is that this is localfs only right now, while all three methods should probably be a part of spec, since multiple filesystems support it (local, ssh, hdfs, probably more). That would again be more in a spirit of FUSE. Looking forward to @martindurant 's opinion on these things. 🙂 |
Let's put them here and allow to sit for a while. Implementation in the spec would be just NotImplemented anyway
I don't think so? Does HDFS really? |
Totally fine with that, was just leaving a friendly comment. Another analogy that comes to mind is
Yeah, it is a bit messy though https://issues.apache.org/jira/browse/HDFS-245 and kinda limited. |
Perhaps if we get a future request, we could add |
What a thread! Still didn't tell me how to do that from the python API :) |
This PR adds
link
/symlink
APIs to create hardlink/symlink, andislink
to check for symlinks.The APIs mirror what we have in
os
andos.path
.There are some open questions about APIs. In DVC, we use
hardlink()
,symlink()
andis_symlink()
APIs which I find to be much better, but I went with other APIs to be consistent with python. Python has not been very consistent though (Path.is_symlink()
,Path.symlink_to
,Path.hardlink_to
, etc).Also, do we need these APIs in
AbstractFileSystem
?