Compare commits

..
1 Commits
Author SHA1 Message Date
sneak c87304135b Rewrite README.md sentence by sentence for a newcomer
check / check (push) Canceled after 0s
Rewrites `README.md` from scratch for
#135. Every statement was checked
against the code on `next` and against what the built binary prints on
small trees under `/var/tmp`. The headings that the code comments cite
are kept. Five `main_test.go` comments cite "Settings", two cite what
"Error handling" says about a failed write to stdout, and one comment
each in `scan_test.go`, `trees_test.go` and `exclude_test.go` cites what
the README now says.

Where the old text and the repository disagreed, the new text states
what the code does: `@latest` installs the newest tagged release, ten
million files in both "Rationale" and "Design", no Windows excludes, and
an operand reached through a symlinked directory below another operand
is dropped (#144).

Model: fable-5-1
2026-10-26 17:13:19 +00:00
2 changed files with 5 additions and 5 deletions

No files matched your search

+4 -4
View File
@@ -841,15 +841,15 @@ Only one `scan` runs against a database at a time.
- For its whole run, `scan` holds a lock on a lock file beside the database. The
lock is taken with the `flock(2)` system call, and only one process can hold
it. The lock file's name is the database's path, with symlinks resolved, plus
`.lock`. By default that is `/var/lib/sfdupes/db.sqlite.lock`. A path through
a symlink names the same lock file.
`.lock`. By default that is `/var/lib/sfdupes/db.sqlite.lock`. Every path to
one database therefore names the same lock file.
- `scan` takes the lock before it walks the filesystem or opens the database.
Just before that, it creates the database file, empty, if it is missing. So
the lock file is named the same way before the first scan as after. A symlink
at the database path is followed, and its target is created.
- A second `scan` against the same database does not wait. It fails at once with
an error naming the lock file, and exits 1. It has walked nothing and has not
opened the database. The running scan carries on.
an error naming the lock file, and exits 1. It has walked nothing and opened
nothing. The running scan carries on.
- The lock file is created on first use and never deleted. Only its owner may
open it. A leftover file blocks nothing. The lock ends with the process that
holds it, however that process ends. Deleting the file while a scan runs would
+1 -1
View File
@@ -1340,7 +1340,7 @@ func assertSecondScanFails(t *testing.T, path string) {
}
func TestRunSecondScanThroughSymlinkFails(t *testing.T) {
// README §Database: a path through a symlink names the same lock
// README §Database: every path to one database names the same lock
// file, so while a scan holds it through one path, a scan through
// another fails, naming the lock file beside the database's real
// path.