Skip to content
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

Change EncrytedFs::read_dir/plus to only show children #273

Open
someotherself opened this issue Dec 23, 2024 · 3 comments
Open

Change EncrytedFs::read_dir/plus to only show children #273

someotherself opened this issue Dec 23, 2024 · 3 comments
Assignees
Labels
good first issue Good for newcomers
Milestone

Comments

@someotherself
Copy link
Collaborator

The fs_api layer must allign with rust standard library.
std::fs::read_dir only iterates over children. Ours should do the same.
Changes are needed for:

  1. encryptedFs function,
  2. tests for encryptedFs and for Path
  3. docs for Path method
@someotherself someotherself added the good first issue Good for newcomers label Dec 23, 2024
@someotherself someotherself added this to the 1.0.0-rc1 milestone Dec 23, 2024
@Hrushi20
Copy link

Hrushi20 commented Dec 23, 2024

Hey! I was trying out both on my system. I see Directory Entry for Encrypted::fs and DirEntry for rust std::fs. What do you mean by align our api to iterate only over children? Can you explain with below example?

Screenshot 2024-12-24 at 00 53 12

@someotherself
Copy link
Collaborator Author

Hey! I was trying out both on my system. I see Directory Entry for Encrypted::fs and DirEntry for rust fs. What do you mean by align our api to iterate only over children? Can you explain with below example?

When running std::fs::read_dir, (I'm testing it on linux and windows) it will only iterate over children and ignore . and ...
read_dir and read_dir_plus in our EncryptedFs current include . and ...
In your example, ino: 1 is root (or parent) dir - .. When running fs.read_dir(1), it should show only the RegularFile.
This is not exactly a bug however, our own fs_api::fs::read_dir will be using these functions and we want it to be 100% interchangeable with std library.
Are you getting a different behaviour out of std::fs::read_dir?

@someotherself someotherself self-assigned this Dec 25, 2024
@radumarias
Copy link
Member

@someotherself let's go like you get the output

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

No branches or pull requests

3 participants