[File] [PATCH] of Magdir/database for DMI Management Information Format *.mif

Jörg Jenderek joerg.jen.der.ek at gmx.net
Sat Jan 4 18:24:16 UTC 2020


Hello,

some weeks ago i had to handle some ImageMagick bitmaps which have
sometimes filename extension mif. When searching on my systems for
such files and similar test files i found a few samples of another
file type using that file name extension. When running file command
version 5.38 such examples are described as text with mime type
text/plain.

For comparison reason i run other utilities.
The file identifier tool TrID  (see
http://mark0.net/soft-trid-e.html) describes such MIF examples
correctly as "Management Information Format" by definition
mif-dmi-u.trid.xml.

Such MIF files describes in a standardized way as text fragments
components like PC. It is mainly used on Windows system. So magic
lines could be added to Magdir/windows or Magdir/wordprocessors.
But best suited in my opinion seems to be Magdir/database.

First i add to Magdir/database a comment with URL on Wikipedia about
Management Information Format (MIF) by line:
 # URL: https://en.wikipedia.org/wiki/Management_Information_Format

On Distributed Management Task Force web site the Desktop Management
Interface Specification (DMI) can be found as PDF document. For that
fact i add a comment line like:
 # Ref.: dmtf.org/sites/default/files/standards/documents/DSP0005.pdf

According to grammar typical at the beginning is a phrase like "Start
Component" for Component Definition. In most cases this phrase is
capitalized but i also found low cased variant like in example2.mif.
According to reference before that phrase a language line should
appear like:
Language=fr|CA|iso8859-1
In my real found examples like mam_21112019.mif generated by Dell
Display Manager for my monitor this part is missing. So i generate a
test example like example-language.mif with such a line.
So magic line to catch all variants now looks like
0 search/27/C Start\040Component DMI Management Information Format

Afterwards file name extension is shown by line
!:ext	mif
Instead of generic mime type for text files i display a used defined
type by line
!:mime	text/x-dmtf-mif

After applying the above mentioned modifications by patch
file-5.38-database-mif.diff then i get an output like

example-language.mif: DMI Management Information Format,
		      ASCII text, with CRLF line terminators
example.mif:          DMI Management Information Format,
		      ASCII text, with CRLF line terminators
example2.mif:         DMI Management Information Format,
		      ASCII text, with CRLF line terminators
mam_03112018.mif:     DMI Management Information Format,
		      ASCII text, with CRLF line terminators
mam_04112018.mif:     DMI Management Information Format,
		      ASCII text, with CRLF line terminators
mam_21112019.mif:     DMI Management Information Format,
		      ASCII text, with CRLF line terminators

I hope my diff file can be applied in future version of
file utility.

With best wishes
Jörg Jenderek
--
Jörg Jenderek



-------------- next part --------------
--- file-5.38/magic/Magdir/database.old	2019-06-19 16:18:55 +0000
+++ file-5.38/magic/Magdir/database	2020-01-04 18:05:13 +0000
@@ -645,3 +645,14 @@
 # From: David Korth <gerbilsoft at gerbilsoft.com>
 0	string	//\ <!--\ <mdb:mork:z\ v="	Mozilla Mork database
 >23	string	x		\b, version %.3s
+
+# URL:		https://en.wikipedia.org/wiki/Management_Information_Format
+# Reference:	https://www.dmtf.org/sites/default/files/standards/documents/DSP0005.pdf
+# From:		Joerg Jenderek
+# Note:		only tested with monitor asset reports of Dell Display Manager
+#		skip start like Language=fr|CA|iso8859-1
+0	search/27/C	Start\040Component	DMI Management Information Format
+#!:mime	text/plain
+!:mime	text/x-dmtf-mif
+!:ext	mif
+


More information about the File mailing list