[File] [PATCH] of Magdir/archive for OpenOffice.org 1.x +extensions +mime types

Jörg Jenderek joerg.jen.der.ek at gmx.net
Fri Mar 20 21:05:45 UTC 2020


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,
some days ago i handled many ZIP archives. Some are just containers
used to store OpenOffice.org 1.x or newer Staroffice files (*.sx?)
or templates (*.st?).

When running file command i get sometimes strange results. When
running file command version 5.38 on such older OpenOffice.org
documents i get an output like:
$RIDETE4.sdb:                OpenOffice.org 1.x Database file
Calc_6.sxc:                  OpenOffice.org 1.x Calc spreadsheet
DocBookTemplate-stw.stw:     OpenOffice.org 1.x Writer template
oo-draw.sxd:                 OpenOffice.org 1.x Draw document
oo-math.sxm:                 OpenOffice.org 1.x Math document
oo-writer-html-template.stw: OpenOffice.org 1.x Writer
oooxml_embedded.sxw:         OpenOffice.org 1.x Writer document
scalc-template.stc:          OpenOffice.org 1.x Calc template
simpress-sti.sti:            OpenOffice.org 1.x Impress template
smaster-sxg.sxg:             OpenOffice.org 1.x Writer global
				document

For one templates only "OpenOffice.org 1.x Writer" is shown without
sub type classification. So for example oo-writer-html-template.stw
the precisely phrase Writer Web template should be shown. On the
other hand for other sub classes the correct type is displayed like
"OpenOffice.org 1.x Calc template" for example scalc-template.stc.

Furthermore with --extension option only ??? is displayed. And with
- -i option application/octet-stream is shown instead specific mime typ
e.

I take information about OpenOffice.org XML OpenDocument file
format found at file formats archive team. Some information can be
found on Wikipedia. So i add to Magdir/archive 2 comment lines like
 # URL:	https://en.wikipedia.org/wiki/OpenOffice.org_XML
 # ref: http://fileformats.archiveteam.org/wiki/OpenOffice.org_XML

Inside Magdir/archive the part for OpenOffice.org 1.x files looks lik
e:
 >>50	string	vnd.sun.xml.		OpenOffice.org 1.x
 >>>62	string	writer			Writer
 >>>>68	byte	!0x2e			document
Afterwards now add 2 lines to show mime type and file name
extension like:
 !:mime	application/vnd.sun.xml.writer
 !:ext	sxw

For missing web variant add later lines
 >>>>68	string	.web			Web template
 !:mime	application/vnd.sun.xml.writer.web
 !:ext	stw
For the other remaining variants then do the the same procedure
adding 2 lines for mime type and file name extension after line
displaying the sub class description.

After applying the above mentioned modifications by patch
file-5.38-archive-OpenOffice.diff then i get output with precise
sub class descriptions, and correct file names extension like:

$RIDETE4.sdb:                OpenOffice.org 1.x Database file
Calc_6.sxc:                  OpenOffice.org 1.x Calc spreadsheet
DocBookTemplate-stw.stw:     OpenOffice.org 1.x Writer template
oo-draw.sxd:                 OpenOffice.org 1.x Draw document
oo-math.sxm:                 OpenOffice.org 1.x Math document
oo-writer-html-template.stw: OpenOffice.org 1.x Writer Web template
oooxml_embedded.sxw:         OpenOffice.org 1.x Writer document
scalc-template.stc:          OpenOffice.org 1.x Calc template
simpress-sti.sti:            OpenOffice.org 1.x Impress template
smaster-sxg.sxg:             OpenOffice.org 1.x Writer global
			 	document

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

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





-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iF0EARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCXnUwFwAKCRCv8rHJQhrU
1pdYAJ9wATB/8TaYVTOkwfg2JVoKnmk3LQCdEHIkZ/djhKZdBipc6EYV8kcGqtI=
=mJE3
-----END PGP SIGNATURE-----
-------------- next part --------------
--- file-5.38/magic/Magdir/archive.old	2019-11-15 21:03:14 +0000
+++ file-5.38/magic/Magdir/archive	2020-03-20 20:50:24 +0000
@@ -1126,2 +1126,4 @@
 #    (mimetype contains "application/vnd.sun.xml.<SUBTYPE>")
+# URL:		https://en.wikipedia.org/wiki/OpenOffice.org_XML
+# reference:	http://fileformats.archiveteam.org/wiki/OpenOffice.org_XML
 >>50	string	vnd.sun.xml.		OpenOffice.org 1.x
@@ -1129,15 +1131,40 @@
 >>>>68	byte	!0x2e			document
+!:mime	application/vnd.sun.xml.writer
+!:ext	sxw
 >>>>68	string	.template		template
+!:mime	application/vnd.sun.xml.writer.template
+!:ext	stw
+>>>>68	string	.web			Web template
+!:mime	application/vnd.sun.xml.writer.web
+!:ext	stw
 >>>>68	string	.global			global document
+!:mime	application/vnd.sun.xml.writer.global
+!:ext	sxg
 >>>62	string	calc			Calc
 >>>>66	byte	!0x2e			spreadsheet
+!:mime	application/vnd.sun.xml.calc
+!:ext	sxc
 >>>>66	string	.template		template
+!:mime	application/vnd.sun.xml.calc.template
+!:ext	stc
 >>>62	string	draw			Draw
 >>>>66	byte	!0x2e			document
+!:mime	application/vnd.sun.xml.draw
+!:ext	sxd
 >>>>66	string	.template		template
+!:mime	application/vnd.sun.xml.draw.template
+!:ext	std
 >>>62	string	impress			Impress
 >>>>69	byte	!0x2e			presentation
+!:mime	application/vnd.sun.xml.impress
+!:ext	sxi
 >>>>69	string	.template		template
+!:mime	application/vnd.sun.xml.impress.template
+!:ext	sti
 >>>62	string	math			Math document
+!:mime	application/vnd.sun.xml.math
+!:ext	sxm
 >>>62	string	base			Database file
+!:mime	application/vnd.sun.xml.base
+!:ext	sdb
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.38-archive-OpenOffice.diff.sig
Type: application/octet-stream
Size: 95 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20200320/9bee34d4/attachment.obj>


More information about the File mailing list