Open files to hash without blocking and reject non-regular ones (closes #100)
check / check (push) Waiting to run

A regular file replaced by a FIFO after the walk statted it made the
hash phase's open wait forever for a writer, so the scan never ended
and kept the lock. The hash and content phases now open each file with
O_NONBLOCK and check with fstat that it is still a regular file;
anything else is a per-path error, warned about and skipped. The new
test replaces a walked file with a FIFO before the hash phase reads it.

Model: opus-5-5
This commit was merged in pull request #107.
This commit is contained in:
2026-10-14 20:18:32 +02:00
parent 1b26b5ce77
commit 5dc6bfb6b7
3 changed files with 87 additions and 4 deletions
+5
View File
@@ -29,6 +29,11 @@
# Completed Steps
- the hash and content phases open each file without blocking and check that it
is still a regular file, so one replaced by a FIFO or device node after it was
statted is warned about and skipped instead of hanging the scan (2026-10-14,
https://git.eeqj.de/sneak/sfdupes/issues/100)
- the scan lock file is named from the database's path with symlinks resolved,
after `scan` creates the database file if it is missing, so a scan through a
symlink to the database fails while another scan holds the lock (2026-10-14,