Code: Select all
aeglos@fangorn:~/.rocksndiamonds$ file levels/testing/002.level
levels/testing/002.level: data
aeglos@fangorn:~/.rocksndiamonds$ file tapes/testing/002.tape
tapes/testing/002.tape: data
aeglos@fangorn:~/.rocksndiamonds$
So here are some lines to add to "/etc/magic" to improve this:
Code: Select all
# ========== Rocks'n'Diamonds user data files (new IFF format) ================
0 string RND1 Rocks'n'Diamonds data
# ---------- Rocks'n'Diamonds level file --------------------------------------
>8 string CAVE \b, level file
>>12 string VERS \b, version
>>>24 byte x %d
>>>25 byte x \b.%d
>>>26 byte x \b.%d
>>>27 byte x \b-%d
>>148 string AUTH \b, author
>>>156 string >\0 "%s"
>>28 string HEAD \b, title
>>>42 string >\0 "%s"
>>>36 byte x \b, size %d
>>>37 byte x x %d
>>>38 beshort x \b, time %d s
# ---------- Rocks'n'Diamonds tape file ---------------------------------------
>8 string TAPE \b, tape file
>>12 string VERS \b, version
>>>24 byte x %d
>>>25 byte x \b.%d
>>>26 byte x \b.%d
>>>27 byte x \b-%d
>>28 string HEAD \b, engine
>>>52 byte x %d
>>>53 byte x \b.%d
>>>54 byte x \b.%d
>>>55 byte x \b-%d
>>>40 belong >700000 \b, date 19%06d
>>>40 belong <700000 \b, date 20%06d
>>56 string INFO \b, level set
>>>66 string >\0 "%s"
>>>>(64.S+66) beshort x \b, level %d
# ========== Rocks'n'Diamonds user data files (old, non-IFF format) ===========
0 string ROCKSNDIAMONDS_ Rocks'n'Diamonds data
# ---------- Rocks'n'Diamonds level file --------------------------------------
>15 string LEVEL_FILE_ \b, level file
>26 string VERSION_ \b, version
>>34 string >\0 %s
>>>44 string >\0 \b, title "%s"
# ---------- Rocks'n'Diamonds tape file ---------------------------------------
>15 string TAPE_FILE_ \b, tape file
>25 string VERSION_ \b, version
>>33 string >\0 %s
Code: Select all
aeglos@fangorn:~/.rocksndiamonds$ file levels/testing/002.level
levels/testing/002.level: Rocks'n'Diamonds data, level file, version 3.2.0-3, author "Holger Schemel", title "nameless level", size 64 x 32, time 30 s
aeglos@fangorn:~/.rocksndiamonds$ file tapes/testing/002.tape
tapes/testing/002.tape: Rocks'n'Diamonds data, tape file, version 3.2.0-2, level set "testing", level 2
aeglos@fangorn:~/.rocksndiamonds$
*EDIT*
I've updated the "magic" file above -- it was missing the (important) engine version for tape files (plus some minor tweaks). Use the "-b" option of "diff" to see the differences (as this forum seems to not allow decent formatting, and whitespaces will come out different on your side), which shows only the non-whitespace differences (so you don't have to re-format all lines (if you care at all about formatting in your "magic" file, that is ;-) )).