the FSF file(1) is inconsistent too, in a way that suggests it's being clever:
~$ file /dev/zero /dev/zero: character special (1/5) ~$ file - < /dev/zero /dev/stdin: data ~$ On Thu, May 3, 2018, 18:36 Rob Landley <r...@landley.net> wrote: > On 05/03/2018 06:40 PM, enh wrote: > > + // If we're working on stdin, copy to a temporary file and then use > > + // an fd for that file. That way the rest of the code doesn't have > to > > + // worry about non-seekable/non-mmap'able input. > > Hmmm, in the old code: > > $ ./file ../filesystems.tar.gz > ../filesystems.tar.gz: gzip compressed data > $ ./file - < ../filesystems.tar.gz > -: gzip compressed data > $ file /dev/zero > /dev/zero: character special > $ file - < /dev/zero > /dev/stdin: data > > That's inconsistent about /dev/zero, not sure why. > > But if we copy /dev/zero to a temp file we'll fill the hard drive... > > Rob >
_______________________________________________ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net