Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
These could be provided by sshfs as well and maybe some other implementations.
I was thinking about maybe creating
stat
andlstat
fields in info instead, but that seemed excessive for now (it will probably make sense to provide both of those in the future since we already have them, but there is a question of whether providing rawstat_result
structure instat
andlstat
info fields is a good practice or if we should add an info-like fieldlink_info
instead). I saw thatuid
andgid
were provided here already, which are quite specific, so felt like inode and nlink were alright to provide too. Obviously open to suggestions. 🙂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.
Just to be clear: the reason why I'm proposing adding these two is that we use them in dvc and right now have to do additional stat calls.
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.
The philosophy in the various backends has been to pass through as many dict keys as seemed reasonable, but only insist on name/type/size. I think the dict version is simpler and so superior to making a stat-like class. As ever, we are somewhat stuck between providing an identical API and specialising to the backends - link_info being a perfect case. Maybe it applies to two FSs rather than one, but most do not have this concept. So in info() we want consistency, but we can make extra methods for calling code that knows to look for them.
That's a good enough reason!
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.
Makes sense. Then I guess we'll end up adding
_stat_to_into()
helper and includinglink_info
into the currentinfo()
result sometime in the future.