How to retrieve magic bytes and offset of an identified file format?

7 views
Skip to first unread message

wolfphil

unread,
Nov 29, 2010, 6:02:16 AM11/29/10
to fits-users
Hello there,

we want to use FITS in our prototype for wiki preservation. FITS
should be used to determine the file format of a given media file
within the wiki once it is ingested.

As performance is important in our case we wanted to have a local
format registry which knows the offset and the magic bytes of a
format. So if a file of a given file format gets ingested for the
first time, the offset and magic bytes of this format should be stored
in the local format registry so that FITS does not have to be used the
next time a file of the same format is ingested.

So there is my problem: I cannot find a way to get to the offset and
the magic bytes because they are not included in the FitsOutput. The
transformed XML does not include these values.

So is there a way to get to these values? As far as I know, FITS (or
better the wrapped tools) determines the file format based on magic
numbers, so I assume the tools used in FITS know these values, so why
are they not included in the output?

I hope someone can help me. Thx in advance for the answers!

Spencer McEwen

unread,
Nov 29, 2010, 10:20:06 AM11/29/10
to fits-...@googlegroups.com
Hello. You are right that FITS does not output the magic number and
offset information. If you change the <display-tool-output> setting in
xml/fits.xml to true, FITS will include the original tool output in the
output XML. However, it does not look like any of the tools that FITS
uses can output these values either.

ffident has a small list of magic numbers and offsets in
tools/ffident/formats.txt, and file utility has a very large list in
tools/file_utility_windows/share/misc/magic

Reply all
Reply to author
Forward
0 new messages