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

POC: deleted files #445

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

tatref
Copy link

@tatref tatref commented Oct 20, 2024

Hi,

This is a quick and dirty POC for #444

Here are the changes

  • I used procfs to walk the processes under /proc/, but we can do this manually if you don't want to add a new dependency. The function to list files is get_deleted_files
  • I added a function to modify the node tree: insert_deleted_file_in_node, maybe it could be merged with build_node
  • The handling of the deleted files is done in walk_it
  • I also made InodeAndDevice pub(crate) and used it to replace a few (u64, u64)

The drawbacks:

  • There is an edge case with multiple deleted hardlinks with different paths: in this case, only the 1st file will be listed
  • I only handle the file size for now (no filecount, filetime...), also WalkData is not used (no regex, ignore_dir...)
  • I hardcoded the flag to handle the deleted files
  • No cfg(windows), unix, linux... yet

On the bright side, there is no change (performance or inner working) if we set handle_deleted_files to false

Let me know what you think about it

@bootandy
Copy link
Owner

thanks, that's an interesting demonstration.

@bootandy
Copy link
Owner

bootandy commented Nov 1, 2024

Thanks, I'll dig into this next week

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