Skip to content

Add methods to query the directory itself #19

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

Merged
merged 3 commits into from
Aug 31, 2019
Merged

Add methods to query the directory itself #19

merged 3 commits into from
Aug 31, 2019

Conversation

ksqsf
Copy link
Contributor

@ksqsf ksqsf commented Aug 30, 2019

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 call dir.metadata(".") or dir.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) and list_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?

@ksqsf ksqsf changed the title Add a method to query the metadata of the directory itself Add methods to query the directory itself Aug 30, 2019
@tailhook tailhook merged commit e4660c1 into tailhook:master Aug 31, 2019
@tailhook
Copy link
Owner

Looks good. Merged.

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.

Hm. Good question. The semantics, that it's not a real file descriptor is still a good argument to keep it deprecated, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants