<div dir="ltr"><div dir="auto"><div>the FSF file(1) is inconsistent too, in a way that suggests it's being clever:<br></div><div dir="auto"><br></div><div dir="auto"><div dir="auto">~$ file /dev/zero</div><div dir="auto">/dev/zero: character special (1/5)</div><div dir="auto">~$ file - < /dev/zero</div><div dir="auto">/dev/stdin: data</div><div dir="auto">~$ </div><div><br></div><div><br></div><div><br></div><div class="gmail_quote" dir="auto"><div dir="ltr">On Thu, May 3, 2018, 18:36 Rob Landley <<a href="mailto:rob@landley.net" target="_blank">rob@landley.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 05/03/2018 06:40 PM, enh wrote:<br>
> + // If we're working on stdin, copy to a temporary file and then use<br>
> + // an fd for that file. That way the rest of the code doesn't have to<br>
> + // worry about non-seekable/non-mmap'able input.<br>
<br>
Hmmm, in the old code:<br>
<br>
$ ./file ../filesystems.tar.gz<br>
../filesystems.tar.gz: gzip compressed data<br>
$ ./file - < ../filesystems.tar.gz<br>
-: gzip compressed data<br>
$ file /dev/zero<br>
/dev/zero: character special<br>
$ file - < /dev/zero<br>
/dev/stdin: data<br>
<br>
That's inconsistent about /dev/zero, not sure why.<br>
<br>
But if we copy /dev/zero to a temp file we'll fill the hard drive...<br>
<br>
Rob<br>
</blockquote></div></div></div></div>