Repository navigation
fs: ignore disappearing files in DiskUsage - #335
Open
Soundcreates wants to merge 1 commit into
Open
Soundcreates wants to merge 1 commit into
Soundcreates wants to merge 1 commit into
Conversation
A file or directory can disappear after filepath.Walk reads its parent but before the entry is inspected. Treat ENOENT for descendants as a transient condition because the removed entry no longer contributes to disk usage. Keep returning errors for a missing root and for all other walk failures. Apply the behavior on Unix and Windows and cover the error handling with regression tests. Assisted-by: OpenAI Codex Signed-off-by: Shantanav Mukherjee <shantanav7@gmail.com>
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.
Closes #332.
DiskUsagecan fail when a descendant disappears after its parent directory is read. This skipsENOENTfor descendants in both Unix and Windows walks while preserving errors for a missing root and other failures.Tests:
go test ./...andgit diff --check.