[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1891: bug report

On Wed, 22 Nov 1995, Gordon Russell wrote:

> Packages: base
> The /etc/magic file does not allow the file command to identify
> elf .a files from aout .a files very easily. Indeed, an elf archive
> : archive
> but an aout archive
> : random archive
> Would someone update this to something more meaningful?

I redirected this bug report to the file package, which is my package.
After thinking about it, I'm closing it without action.

The file program is reporting the type of the archive file itself.
What you want it to do is report the file type of the files in the
archive, and it's not designed to do that.

A workaround would be to say something like:

   ar p libm.a `ar t libm.a | head -1` | file -

That'll get you the file type of the initial file in the archive,
plus a spurious error message from the kernel about a broken pipe.

The spurious error could be eliminated with something like:

   ar p libm.a `ar t libm.a | head -1` >/tmp/$$;file /tmp/$$;rm /tmp/$$

If you think I'm missing something here, please let me know.

Reply to: