Add methods to query the directory itself #19
Merged
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.
I'm using
openat
to access the directory which is used as the mount point of a fuse filesystem. Unfortunately, during the initialization I cannot simply calldir.metadata(".")
ordir.list_dir(".")
because that would access the fuse fs itself instead of the directory! (speaking of macOS, not sure about Linux tho)Therefore, I propose new methods
self_metadata
(fstat
under the hood) andlist_self
to query the directory itself.PS: this makes me wonder if deprecating
cwd
is a good decision tho. If the cwd is some directory A, but later a fs is mounted on A,Dir::open(".")
will probably open the root of the fs instead of the directory A. I haven't tested so I'm not sure about this.btw, do you have a better name?