On Sep 17 07:30:23, st...@cvs.openbsd.org wrote:
> update to libmagic (file) 5.25

What is the relation of OpenBSD's own new file(1) to devel/libmagic?

The magic(5) file used by file(1) is version 4.24, while
the magic(4) file that comes with libmagic is version 5.25.
Can libmagic use the /etc/magic that comes with file(1)?
It doesn't seem to be the case: the naive program below
shows a bunch of errors when trying to magic_compile(),
starting with

        /tmp/magfile, 627: Warning: string modifier `B' invalid
        /tmp/magfile, 628: Warning: Current entry does not yet have
        a description for ad ding a MIME type

Is this the discrepancy in the magic file format version?
Does that mean that /etc/magic is only used/usable by file(1),
but ports using libmagic (e.g. sox) can only use the magic file
that comes with it, /usr/local/share/misc/magic.mgc ?

        Jan




#include <magic.h>

int
main()
{
        magic_t cookie = NULL;
        cookie = magic_open(MAGIC_NONE);
        magic_compile(cookie, "/tmp/magfile");
        magic_close(cookie);
        return 0;
}

Reply via email to