-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
dir::get_size
's handling of symlinks
This makes `dir::get_size` give a correct calculation of the size of a path of directory, that now matches that returned by eg: `du --bytes -s <path>`. Before: - Symlinks were followed, causing double-counting of symlinked files (see #59). - Whilst the metadata size of subdirectory entries was counted correctly, the metadata size of the parent directory (the initial `path` passed into `dir::get_size`) was not counted. See: #25 (comment) Now: - Symlinks are no longer followed (fixing the regression from #34), so that only the size of the symlink itself is included (as expected), and not the size of the symlink's target. - If the initial `path` passed into `dir::get_size` is a directory, the size of that directory entry itself is now correctly counted (like it was already being counted for subdirectories). Fixes #25. Fixes #59.
- Loading branch information
Showing
2 changed files
with
76 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters