Author Topic: updated iff-pch.trid.xml for IFF binary Patch  (Read 639 times)

jenderek

  • Sr. Member
  • ****
  • Posts: 375
updated iff-pch.trid.xml for IFF binary Patch
« on: February 04, 2024, 03:22:53 PM »
Hello trid users,

some days ago i must handle some patch files. Sometimes the file name suffix
PCH is used. For control reason i look for samples with that suffix on my
systems. In context of "Amiga" operating system i found such samples.

So i run trid utility on such examples with PCH suffix. The samples are
"recognized" and described as "IFF binary Patch" with mime type
application/octet-stream and 2 suffix (.PCH/PATCH) by iff-pch.trid.xml. No
reference URL is listed here (see appended trid-v-old.txt in output).

For comparison reason i also run the file format identification utility DROID
(See https://sourceforge.net/projects/droid/). Here the samples are recognized
generic and described as "Interchange File" by PUID x-fmt/157. Here PCH suffix
is considered as "bad".

For comparison reason i also run file command (version 5.45) on such samples.
Here the samples are also "recognized". These are here described as "IFF data"
and "PTCH binary patch" (see appended file-5.45.txt in output). Here also
generic application/octet-stream mime type is shown (see appended
file-i-5.45.txt) and no suffix is here shown (see appended file-ext-5.45.txt).

On Linux according to shared MIME-info database such samples are called "IFF
file" or as alias expanded "Interchange File Format".  Here "application/x-iff
is used as mime type. The samples are just recognized by looking for 4 byte
sequence FORM at the beginning. Here no suffix are listed. That information
can be seen in source freedesktop.org.xml.in found for example on
gitlab.freedesktop.org.

The samples are also described with low priority as "Generic IFF container"
with mime type application/x-iff by iff-gen.trid.xml. Here page about
"Interchange File Format" on Wikipedia is used as reference. So "Generic IFF
container" is "container" format for such Amiga patches because file start
with characteristic 4 byte magic. That is expressed by first XML
construct. That looks like:
   <Bytes>464F524D</Bytes>
   <ASCII> F O R M</ASCII>
   <Pos>0</Pos>

The sub classification is done by 4 byte pattern at offset 4. That is
expressed by second XML construct. That looks like:
   <Bytes>5054434856455253</Bytes>
   <ASCII> P T C H V E R S</ASCII>
   <Pos>8</Pos>

This sub classification information can be found on page about IFF FORM and
Chunk Registry on Amiga OS web server. So i choose this instead of generic
Wikipedia page. So here this is now expressed by line like:
 <RefURL>https://wiki.amigaos.net/wiki/IFF_FORM_and_Chunk_Registry</RefURL>

For such files i found no mime type. But the patches are a sub class of
IFF. So in my opinion the patches should at least get then the mime type of
container. So this is now expressed by line like:
   <Mime>application/x-iff</Mime>

With the updated definition my inspected Amiga patches are still described but
now more details like mime type and reference is also shown (see appended
trid-v-new.txt in output).

TrID definitions and output are stored in archive pch_amiga.zip. I hope that
my definition can be used in future version of triddefs.

With best wishes
Jörg Jenderek

Mark0

  • Administrator
  • Hero Member
  • *****
  • Posts: 2743
    • Mark0's Home Page
Re: updated iff-pch.trid.xml for IFF binary Patch
« Reply #1 on: February 08, 2024, 11:49:52 AM »
Thanks for the update!