[File] [PATCH] of Magdir/sql SQLite 2.x database+ mime type + extensions
Christos Zoulas
christos at zoulas.com
Sat Apr 29 17:28:41 UTC 2023
Applied, thanks!
christos
> On Apr 25, 2023, at 5:46 PM, Jörg Jenderek <joerg.jen.der.ek at gmx.net> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello,
>
> some days ago i send patch for SQLite 3.x database. That concerns
> version 3 of this database type, but there exist also older variants.
> When running file command (version 5.44) on such older databases and
> test examples i get an output like:
> FileAttributesStore.db: SQLite 2.x database
> TextCache.db: SQLite 2.x database
> test-sqlite2.sqlite: SQLite 2.x database
> test.sqlite2: SQLite 2.x database
>
> At first glance this does not look bad, but when running with
> - --extension option i get output like:
> FileAttributesStore.db: ???
> TextCache.db: ???
> test-sqlite2.sqlite: ???
> test.sqlite2: ???
>
> When running with -i option i get output like:
> FileAttributesStore.db: application/octet-stream; charset=binary
> TextCache.db: application/octet-stream; charset=binary
> test-sqlite2.sqlite: application/octet-stream; charset=binary
> test.sqlite2: application/octet-stream; charset=binary
>
> For comparison reason i run the file format identification utility
> TrID ( See https://mark0.net/soft-trid-e.html). The examples are here
> described with as "SQLite 2.x database" with mime type
> application/x-sqlite2 and 2 suffix (sqlite2 sqlite) by
> sqlite-2x.trid.xml (See appended trid-v-sqlite2.txt.gz).
>
> For comparison reason i also run the file format identification
> utility DROID ( See https://sourceforge.net/projects/droid/). Here
> the samples are also recognized and are described generic as "SQLite
> Database File Format" with version "2" and without mime type by PUID
> fmt/1135. Only the sqlite and db name suffix are considered here as
> valid, whereas the sqlite2 suffix is considered here as "bad" (see
> true EXTENSION_MISMATCH in appended droid-sqlite2.csv.gz).
>
> TrID list the used file name extension and often with -v option the
> related URL pointing to some information. So i found here again page
> about SQLite on Wikipedia and file formats archive team web site.
> This is now expressed by additional comment lines inside Magdir/sql
> like:
> # Reference: http://mark0.net/download/triddefs_xml.7z
> # defs/s/sqlite-2x.trid.xml
>
> The description of SQLite 2.x database happens inside Magdir/sql by
> line like:
> 0 string **\ This\ file\ contains\ an\ SQLite SQLite 2.x database
>
> According to DROID and TrID definition mime type and file names
> extensions now also shown. So this now becomes like:
> 0 string **\ This\ file\ contains\ an\ SQLite SQLite 2.x database
> !:mime application/x-sqlite2
> !:ext sqlite/sqlite2/db
>
> After applying the above mentioned modifications by patch
> file-5.44-sql-sqlite2.diff then i get a more precise output.
>
> With additional --extension option now i get:
> FileAttributesStore.db: sqlite/sqlite2/db
> TextCache.db: sqlite/sqlite2/db
> test-sqlite2.sqlite: sqlite/sqlite2/db
> test.sqlite2: sqlite/sqlite2/db
>
> With additional -i option now i get:
> FileAttributesStore.db: application/x-sqlite2; charset=binary
> TextCache.db: application/x-sqlite2; charset=binary
> test-sqlite2.sqlite: application/x-sqlite2; charset=binary
> test.sqlite2: application/x-sqlite2; charset=binary
>
> I hope my diff file can be applied in future version of
> file utility.
>
> There are also mentioned are more older variants. According to
> comments inside Magdir/sql Version 1 used GDBM internally and its
> files cannot be distinguished. I had difficulties to get version 2
> samples so i do not try this for version 1. So maybe other users may
> have such very old examples and check such samples.
>
> With best wishes
> Jörg Jenderek
> - --
> Jörg Jenderek
> -----BEGIN PGP SIGNATURE-----
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iF0EARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCZEhKTwAKCRCv8rHJQhrU
> 1tjrAJ9+T+OvCYCUDdzQVDUdJ3fgFZxjKwCgrLvRbdv57C4IXsu/tSOifVVsWFo=
> =YhHL
> -----END PGP SIGNATURE-----
> <droid-sqlite2.csv.gz><trid-v-sqlite2.txt.gz><file-5_44-sql-sqlite2_diff.DEFANGED-0><file-5_44-sql-sqlite2_diff_sig.DEFANGED-1>--
> File mailing list
> File at astron.com
> https://mailman.astron.com/mailman/listinfo/file
> <sanitizer.log>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: Message signed with OpenPGP
URL: <https://mailman.astron.com/pipermail/file/attachments/20230429/188ccac6/attachment.asc>
More information about the File
mailing list