Repository navigation
fix: Duplicate Finder says why a folder could not be scanned, and counts two names of one file once - #2950
Merged
laurentiu021 merged 1 commit intoOct 22, 2026
Conversation
…nts two names of one file once - DuplicateFileService.ScanAsync returns a DuplicateScan: the groups, or why the chosen folder could not be scanned (NotFound, IsLink, Unreadable, Excluded), shaped like Disk Analyzer's Analysis. A missing folder, a link, a root Windows would not list and a root the walk leaves out all came back as an empty list, which the tab reported as "No duplicates found". The root is listed on its own, so a folder below it that cannot be listed is still skipped. - The full hash asks the handle it reads for the file's identity and skips another name of a file already hashed. Two names of one file were a group with the file's size wasted, though deleting either frees nothing. - FileIdentity, in Helpers, holds the volume serial number and the 128-bit file ID from GetFileInformationByHandleEx(FileIdInfo), which is unique on ReFS too, and LinksOf, which File Shredder now reads its hard-link count through instead of its own copy of BY_HANDLE_FILE_INFORMATION. - The tab shows the reason in its empty state and on the status line, and the two reasons it shares with Disk Analyzer word for word live once, in ViewModelBase.
laurentiu021
deleted the
fix/duplicate-finder-says-why-and-skips-hard-links
branch
October 22, 2026 06:05
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Duplicate Finder had the failure-as-empty shape Disk Analyzer had until #2504, and it counted two names of one file as
two copies.
What changed
DuplicateFileService.ScanAsyncreturns aDuplicateScan: thegroups, or a
ScanFailure(NotFound,IsLink,Unreadable,Excluded), shaped like Disk Analyzer'sAnalysis.A missing folder, a link, a root Windows would not list (
C:\System Volume Information, for one) and a root thewalk leaves out all came back as an empty list, which the tab reported as "No duplicates found". The root is now
listed on its own, so only it fails the scan: a folder below it that cannot be listed is still skipped. The tab
shows the reason in its empty state and on the status line, and a scan that could not run is not counted as one.
skips another name of a file already hashed, so a hard link leaves the group and the space wasted. Before, a 64 KB
file with a second name was a group of two with 65,536 bytes wasted.
Helpers/FileIdentityholds the volume serial number and the 128-bit file ID fromGetFileInformationByHandleEx(FileIdInfo), which stays unique on ReFS, where the 64-bit indexGetFileInformationByHandlereturns does not. ItsLinksOfis the hard-link count File Shredder refuses a shred on,moved from the shredder's own copy of
BY_HANDLE_FILE_INFORMATION; the shredder's behaviour is unchanged.not list) are constants in
ViewModelBase, which both use.DuplicateFileService,Helpers/FileIdentity).Tests
NotFound), a root that is a link (IsLink), a root whose listingthrows access denied, an I/O error (
Unreadable) or not found (NotFound), and a$Recycle.Binpicked as the root(
Excluded). A folder below the root that cannot be listed is skipped and the rest scanned.Symlinks.RequireHardLink: two names of one file are no group; a copy beside them is onegroup of two with one file wasted.
FileIdentityTestschecks that two names share an identity and two links, and acopy has its own identity and one link.
what it found, and every failure has its own explanation.
Each test failed against the defect it pins: with each failure returned as no failure, the excluded root scanned, a
subfolder that cannot be listed failing the scan, the identity check removed, every file given the same ID, the
shredder's link count ignored, and the tab ignoring the failure.
Closes #2823.