mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
[PR #422] [MERGED] fix: retrieve metadata for symbolic links without following them #479
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/422
Author: @wugeer
Created: 7/28/2024
Status: ✅ Merged
Merged: 7/31/2024
Merged by: @bootandy
Base:
master← Head:feature_fix_soft_link_size_new📝 Commits (1)
f661793fix: retrieve metadata for symbolic links without following them📊 Changes
5 files changed (+51 additions, -17 deletions)
View changed files
📝
src/dir_walker.rs(+13 -3)📝
src/main.rs(+1 -1)📝
src/node.rs(+7 -7)📝
src/platform.rs(+14 -2)📝
src/utils.rs(+16 -4)📄 Description
Background
Previously, the function get_metadata in platform.rs used
fs::metadatawhich follows symbolic links and returns metadata for the target file. This caused issues https://github.com/bootandy/dust/issues/421: du / dust disagreement when trying to determine properties of the symbolic link itselfFull Changelogs
Issue Reference
du / dust disagreement: https://github.com/bootandy/dust/issues/421
Test Result
cargo test command output
du -s output vs cargo run -- -ok /home/shirley/code/python/official/superset/superset-frontend
du -s -L output vs cargo run -- -ok -L /home/shirley/code/python/official/superset/superset-frontend
while use dust v1.0.0 command,

The output shows that dust v1.0.0 produces the same results regardless of whether the -L parameter is used. That disagrees with du command.
performance test results
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.