Age | Commit message (Collapse) | Author |
|
next few fields in the order the other implementation outputs, fewer commas,
fix a big where big endian executable type wasn't detected right,
and fix the filehandle leak.
|
|
|
|
|
|
|
|
|
|
- per POSIX, 'cannot open' must be in the 'type' string if open() fails
(both EPERM and ENOENT); we only do that if open() succeeds and fstat(fd)
fails.
- symlink detection (as per POSIX) won't work: opening them O_RDONLY
results in following the link, then we fstat() the fd.
- file 'FIFO' causes a hang; open() won't return till there's a writer.
|
|
|
|
|
|
|
|
Unlike the POSIX file(1), there's no magic file here, just hard-coded
common (non-obsolete) file formats. Personally most of my use of file(1)
is as a one-line readelf(1) summarizer, so although I assume a full POSIX
file(1) is out of scope (because just the database would likely be larger
than all the rest of toybox), a subset that only supports in-use file types
actually covers most of the use cases I encounter personally.
Also fix peek_be/peek_le.
|