Repository navigation
Conversation
- Detect Windows-hidden entries: dotfiles, the hidden file attribute, and the shell-hidden folders Explorer suppresses (AppData and legacy junctions). - Skip junctions/cloud reparse points instead of following them, and report them as not followed. - Attribute large files by registry install location on Windows while keeping exact pacman ownership on Arch. - Replace SIGALRM with a portable deadline so per-folder timeouts work on Windows; sparse-file accounting is unchanged on POSIX. - Fall back to logical size when the OS does not report st_blocks. - Add scripts/scan.ps1; scan.sh and the POSIX paths are unchanged. - Update the test suite for both platforms (14 tests) and make --folder report a visible entry as not hidden instead of "not found".
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.
What
Makes the
pc-cleanscanner run on Windows as well as Linux and macOS, without changing what it reports and without making it any less read-only. A single implementation (scripts/scan.py) branches on the current platform;scan.ps1andscan.shonly locate Python and forward arguments.Why
The scanner assumed a POSIX home:
AppData— normally the largest per-user storage area;SIGALRM, which does not exist on Windows;st_blocks, which Windows does not report;pacman -Qqo.The result on Windows was either a crash or a misleadingly empty report.
Changes
AppData,Application Data,Local Settings,Cookies, …). Non-Windows behaviour stays dot-prefix only.Application Data→AppDataaliases.pacman -Qqoownership. Windows matches a file against registry uninstall entries that publish anInstallLocationand labels it as an install-location match. When neither applies, the report says no per-file owner is available instead of guessing.SIGALRMis replaced by atime.monotonic()deadline checked between entries, so--timeoutworks on every platform.st_blocks, so sparse-file accounting on Linux is unchanged.scripts/scan.ps1;scan.shis untouched.--folder <visible-name>now reports "exists but is not a hidden entry" instead of "not found".Safety
Still report-only: no writes, no deletions, no state changes, no elevation. The scanner refuses protected home directories and reports ACL-denied folders as
[partial]rather than as clean or zero-sized.Testing
python -B tests/test_scan.py→ 14 passed (Windows 11, Python 3.13).~,--dotfiles-only,--folder .config,--folder AppData(~7.9k directories, 4 ACL-denied folders correctly partial), the.ps1wrapper, and all argument/error paths.Known limitations (documented in
SKILL.md)--timeout.