[PR #399] [MERGED] feat: Added the ability to filter the corresponding files based on the access_time, modify time, and change time of the file for statistics. #464

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

📋 Pull Request Information

Original PR: https://github.com/bootandy/dust/pull/399
Author: @wugeer
Created: 5/17/2024
Status: Merged
Merged: 6/25/2024
Merged by: @bootandy

Base: masterHead: feature_xhw


📝 Commits (1)

  • abc5605 feat: Added the ability to filter the corresponding files based on the access time, modify time, and change time of the file for statistics

📊 Changes

14 files changed (+277 additions, -45 deletions)

View changed files

📝 Cargo.lock (+6 -6)
📝 completions/_dust (+6 -0)
📝 completions/_dust.ps1 (+6 -0)
📝 completions/dust.bash (+25 -1)
📝 completions/dust.elv (+6 -0)
📝 completions/dust.fish (+3 -0)
📝 man-page/dust.1 (+10 -1)
📝 src/cli.rs (+27 -0)
📝 src/config.rs (+73 -0)
📝 src/dir_walker.rs (+36 -22)
📝 src/main.rs (+7 -0)
📝 src/node.rs (+17 -8)
📝 src/platform.rs (+41 -6)
📝 src/utils.rs (+14 -1)

📄 Description

Background

Filter by file age https://github.com/bootandy/dust/issues/340
Add a new feature to dust to filter files based on their last update time, last access time, and last modification time.

In order to achieve this requirement, I referred to the input of the linux find command, and ultimately planned to implement the dust filter by file age function based on the input style of find.

image

I have a little question here, why does dust output files or directories with a file size of 0 by default? The dust tool is used to quickly find those files and directories in the specified directory that take up too much space, and those empty files or directories will only affect the look and feel. Originally, I have implemented filtering out those files or directories with a size of 0, but when I run cargo test When running the test, I found that some samples reported errors, so I canceled this part of the code, but I still wanted to retain the function of filtering out those files or directories with a size of 0. I hope this function can be further explored. thanks

Full Changelogs

  • feat: Added the ability to filter the corresponding files based on the access_time, modify time, and change time of the file for statistics

Issue Reference

fix: Filter by file age https://github.com/bootandy/dust/issues/340

Test Result

dust help command output
image

Test Data

image

cargo test run test results

image

Adding --mtime or --atime or --ctime results in actual execution of dust and linux find with similar parameters.

image

image

image

image

image


🔄 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/399 **Author:** [@wugeer](https://github.com/wugeer) **Created:** 5/17/2024 **Status:** ✅ Merged **Merged:** 6/25/2024 **Merged by:** [@bootandy](https://github.com/bootandy) **Base:** `master` ← **Head:** `feature_xhw` --- ### 📝 Commits (1) - [`abc5605`](https://github.com/bootandy/dust/commit/abc5605714f6c9cd8ed4c20995c9659b5f01434d) feat: Added the ability to filter the corresponding files based on the access time, modify time, and change time of the file for statistics ### 📊 Changes **14 files changed** (+277 additions, -45 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+6 -6) 📝 `completions/_dust` (+6 -0) 📝 `completions/_dust.ps1` (+6 -0) 📝 `completions/dust.bash` (+25 -1) 📝 `completions/dust.elv` (+6 -0) 📝 `completions/dust.fish` (+3 -0) 📝 `man-page/dust.1` (+10 -1) 📝 `src/cli.rs` (+27 -0) 📝 `src/config.rs` (+73 -0) 📝 `src/dir_walker.rs` (+36 -22) 📝 `src/main.rs` (+7 -0) 📝 `src/node.rs` (+17 -8) 📝 `src/platform.rs` (+41 -6) 📝 `src/utils.rs` (+14 -1) </details> ### 📄 Description # Background Filter by file age https://github.com/bootandy/dust/issues/340 Add a new feature to dust to filter files based on their last update time, last access time, and last modification time. In order to achieve this requirement, I referred to the input of the linux find command, and ultimately planned to implement the dust filter by file age function based on the input style of find. ![image](https://github.com/bootandy/dust/assets/20339490/dd2fc3f1-2df3-4233-b7dc-c6a4086e7825) I have a little question here, why does dust output files or directories with a file size of 0 by default? The dust tool is used to quickly find those files and directories in the specified directory that take up too much space, and those empty files or directories will only affect the look and feel. Originally, I have implemented filtering out those files or directories with a size of 0, but when I run cargo test When running the test, I found that some samples reported errors, so I canceled this part of the code, but I still wanted to retain the function of filtering out those files or directories with a size of 0. I hope this function can be further explored. thanks # Full Changelogs - feat: Added the ability to filter the corresponding files based on the access_time, modify time, and change time of the file for statistics # Issue Reference fix: Filter by file age https://github.com/bootandy/dust/issues/340 # Test Result dust help command output ![image](https://github.com/bootandy/dust/assets/20339490/3fd00bcb-72c4-48e7-ad5d-ec99f5c468e1) Test Data ![image](https://github.com/bootandy/dust/assets/20339490/4513fb21-aa2e-4dae-b241-5b4ce77bfb77) cargo test run test results ![image](https://github.com/bootandy/dust/assets/20339490/321dc7f0-68ce-4032-8b0b-20c9140c1dec) Adding --mtime or --atime or --ctime results in actual execution of dust and linux find with similar parameters. ![image](https://github.com/bootandy/dust/assets/20339490/8eb8df0c-e895-408d-8f9b-417a7237af0c) ![image](https://github.com/bootandy/dust/assets/20339490/b7378a54-2e50-40e3-9654-4fae723c0b30) ![image](https://github.com/bootandy/dust/assets/20339490/e44fb24e-1039-4640-a29c-ab5890a0f591) ![image](https://github.com/bootandy/dust/assets/20339490/31b34df0-1cca-470f-955b-f819957b571f) ![image](https://github.com/bootandy/dust/assets/20339490/61146dec-49ec-45a0-a882-eec3041d4c06) --- <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:30 +03:00
zhus closed this issue 2026-06-08 11:28:32 +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#464