mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
[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
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 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:
master← Head:feature_xhw📝 Commits (1)
abc5605feat: 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.
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
Issue Reference
fix: Filter by file age https://github.com/bootandy/dust/issues/340
Test Result
dust help command output

Test Data
cargo test run test results
Adding --mtime or --atime or --ctime results in actual execution of dust and linux find with similar parameters.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.