[File] Patch to fix file -n/--no-buffer

Charles Blake charles.l.blake2 at gmail.com
Sun Dec 6 13:41:47 UTC 2020


Attached is a patch to make, e.g.
  find . -print0|xargs -0P30 file -n|sed -n 's/: .*pie executable.*//p'
work reliably (with a net speed-up near 30x, if you have that many cores).
{ At least reliably subject to extra conditions that no filename or type
contains ":<SPACE>" and every answer is < atomic pipe write limit.  Both
of these are very common cases, especially the latter and in any event
'file -F ::INCONceivable::' or some such can work around the former. }

Without this patch, stdout flushing only happens in "file -f fileList"
mode which interleaves output from various kid processes of xargs.
While one can work around this with a 'stdbuf -L', that can add a
bit of overhead.  Better to just make --no-buffer work as was likely
always intended.

The patch also corrects grammar in the man page.

I tried to set up accounts on the bug tracker twice unsuccessfully.
So, hopefully this email goes through and is enough to get in the
patch (or some variation of the fix).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.astron.com/pipermail/file/attachments/20201206/5b696889/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nobuffer.patch
Type: text/x-patch
Size: 1248 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20201206/5b696889/attachment.bin>


More information about the File mailing list