Read only regular files in gen, freshen and check (closes #189) #199

Merged
clawbot merged 1 commits from issue-189-regular-files-only into next 2026-10-13 16:39:10 +02:00
Collaborator

Opening a named pipe that has no writer blocks until one appears, so gen and freshen hung on a tree holding a pipe, and check hung on a listed path that is a pipe on disk. Fixes #189.

  • gen (through Scanner) and freshen list regular files only; with --follow-symlinks this applies to what the symlink points to. Each skipped entry is logged at verbose level as skipping PATH: not a regular file.
  • check reports a listed path that is not a regular file with the existing ERROR status and the message not a regular file, without opening it.
  • The search for extra files skips pipes, sockets and devices by the type of the entry itself, before the symlink handling that #192 reworks next in the same function.
  • The README Tool Examples say gen and freshen list regular files only.

Not visible in the diff:

  • makePipe in the tests opens the pipe for writing after 5 seconds, so a regression fails the test instead of hanging the suite. It lets one read through, which is why each symlink test points at a second pipe outside the tree.
  • A pipe named directly as a gen argument is skipped too, so gen writes a manifest listing no files rather than failing.

Judgement call: the pipe tests build on unix only (//go:build unix), where syscall.Mkfifo exists.
Unverified: sockets and devices are not tested; the tests use pipes.

Model: opus-5-5

Opening a named pipe that has no writer blocks until one appears, so `gen` and `freshen` hung on a tree holding a pipe, and `check` hung on a listed path that is a pipe on disk. Fixes https://git.eeqj.de/sneak/mfer/issues/189. - `gen` (through `Scanner`) and `freshen` list regular files only; with `--follow-symlinks` this applies to what the symlink points to. Each skipped entry is logged at verbose level as `skipping PATH: not a regular file`. - `check` reports a listed path that is not a regular file with the existing `ERROR` status and the message `not a regular file`, without opening it. - The search for extra files skips pipes, sockets and devices by the type of the entry itself, before the symlink handling that https://git.eeqj.de/sneak/mfer/issues/192 reworks next in the same function. - The README Tool Examples say `gen` and `freshen` list regular files only. Not visible in the diff: - `makePipe` in the tests opens the pipe for writing after 5 seconds, so a regression fails the test instead of hanging the suite. It lets one read through, which is why each symlink test points at a second pipe outside the tree. - A pipe named directly as a `gen` argument is skipped too, so `gen` writes a manifest listing no files rather than failing. Judgement call: the pipe tests build on unix only (`//go:build unix`), where `syscall.Mkfifo` exists. Unverified: sockets and devices are not tested; the tests use pipes. Model: opus-5-5
clawbot added the needs-review label 2026-10-13 15:04:52 +02:00
clawbot self-assigned this 2026-10-13 15:04:52 +02:00
clawbot added 1 commit 2026-10-13 15:04:52 +02:00
Opening a named pipe that has no writer blocks, so gen and freshen hung
on a tree holding one, and check hung on a listed path that is a pipe on
disk. gen and freshen now list regular files only (with
--follow-symlinks, what a symlink points to must be one) and name what
they skip with -v. check reports a listed path that is not a regular
file as an error without opening it, and its search for extra files
leaves out pipes, sockets and devices.

Judgement call: the pipe tests build on unix only, where syscall.Mkfifo
exists.
Unverified: sockets and devices are not tested; the tests use pipes.

Model: opus-5-5
Author
Collaborator

Review passed.

  • Judgement call: a pipe, socket or device named directly to gen is skipped, and gen writes a manifest listing no files, as it does for an empty directory. The issue asks for regular files only and not for a refusal, so this meets its definition of done.
  • Left for later: check still reports a symlink to a pipe, socket or device as an extra file. #192 sets which symlinks that search reports, and its rule covers this case.

Model: opus-5-5

Review passed. - Judgement call: a pipe, socket or device named directly to `gen` is skipped, and `gen` writes a manifest listing no files, as it does for an empty directory. The issue asks for regular files only and not for a refusal, so this meets its definition of done. - Left for later: `check` still reports a symlink to a pipe, socket or device as an extra file. https://git.eeqj.de/sneak/mfer/issues/192 sets which symlinks that search reports, and its rule covers this case. Model: opus-5-5
clawbot merged commit e633d3a31b into next 2026-10-13 16:39:10 +02:00
clawbot deleted branch issue-189-regular-files-only 2026-10-13 16:39:11 +02:00
Sign in to join this conversation.