[PR #445] [CLOSED] POC: deleted files #487

Closed
opened 2026-06-08 11:28:44 +03:00 by zhus · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bootandy/dust/pull/445
Author: @tatref
Created: 10/20/2024
Status: Closed

Base: masterHead: feat-deleted-files


📝 Commits (3)

  • 5b1c8a3 WIP: deleted files
  • 3d54b07 canonicalize to prevent mixed absolute/relative path
  • fe74d6c handle case when a parent folder is deleted

📊 Changes

4 files changed (+163 additions, -9 deletions)

View changed files

📝 Cargo.toml (+1 -0)
📝 src/dir_walker.rs (+154 -2)
📝 src/node.rs (+7 -6)
📝 src/platform.rs (+1 -1)

📄 Description

Hi,

This is a quick and dirty POC for https://github.com/bootandy/dust/issues/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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bootandy/dust/pull/445 **Author:** [@tatref](https://github.com/tatref) **Created:** 10/20/2024 **Status:** ❌ Closed **Base:** `master` ← **Head:** `feat-deleted-files` --- ### 📝 Commits (3) - [`5b1c8a3`](https://github.com/bootandy/dust/commit/5b1c8a32612c325936eace97a8e772a7ad496edd) WIP: deleted files - [`3d54b07`](https://github.com/bootandy/dust/commit/3d54b07681bab120bb228bc42f43c4feaeffb885) canonicalize to prevent mixed absolute/relative path - [`fe74d6c`](https://github.com/bootandy/dust/commit/fe74d6c448c4f85e956328f9677a7ee36420031b) handle case when a parent folder is deleted ### 📊 Changes **4 files changed** (+163 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.toml` (+1 -0) 📝 `src/dir_walker.rs` (+154 -2) 📝 `src/node.rs` (+7 -6) 📝 `src/platform.rs` (+1 -1) </details> ### 📄 Description Hi, This is a quick and dirty POC for https://github.com/bootandy/dust/issues/444 Here are the changes * I used [procfs](https://github.com/eminence/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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
zhus added the pull-request label 2026-06-08 11:28:44 +03:00
zhus closed this issue 2026-06-08 11:28:45 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#487