You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
file classifies by filename extension instead of content, calls an empty file 'ASCII text', reports a missing operand on stderr with exit 1 (file(1): stdout, exit 0), and defaults to '.' with no operands #1383
Probe-verified (same-source mingw+Wine harness, two runs; oracle: file(1) from the file package). The file applet's overall form diverges from file(1) in four measured ways:
Classification by extension, not content. A plain-text file named x.jpg → WinuxCmd: x.jpg: JPEG image data. file(1): x.jpg: ASCII text. (The implementation falls back to extension mapping where its magic table has no entry.)
An empty file is never empty. Zero-byte file e → WinuxCmd: e: ASCII text. file(1): e: empty.
Missing operand: wrong stream, wrong exit code, wrong text.file missing → WinuxCmd prints file: cannot access 'missing': No such file or directory to stderr, exit 1. file(1) prints missing: cannot open 'missing' (No such file or directory) to stdout, exit 0.
No operands defaults to .. Bare file → WinuxCmd prints .: directory, exit 0. file(1) prints its Usage text, exit 1.
Expected (file(1))
Content-based classification only; empty for zero-length files; per-operand errors reported in the result column on stdout without failing the run; no default operand.
Source
src/commands/file.cpp: classification chain (magic table → extension fallback), error reporting routed through the shared error printer instead of the result list, and a . default injected when the operand list is empty.
Regression seed
In-repo tests named with this issue number: the four probes above.
Activity
Merge pull request #1399 from unixwin/fix/winx5-text