Using addmeta and delmeta does not work as intended. The following message is displayed when using these two commands.
Code:
"file not writeable"
Here are the steps needed to recreate this message. I will be using a29a02.chd as an example.
CHDMan info [v0.147u3]
Code:
D:\>chdman-0.147u3 info -i "a29a02.chd"
chdman - MAME Compressed Hunks of Data (CHD) manager 0.147u3 (Nov 19 2012)
Input file: a29a02.chd
File Version: 5
Logical size: 32,112,640 bytes
Hunk Size: 4,096 bytes
Total Hunks: 7,840
Unit Size: 512 bytes
Total Units: 62,720
Compression: lzma (LZMA), zlib (Deflate), huff (Huffman), flac (FLAC)
CHD size: 16,153,397 bytes
Ratio: 50.3%
SHA1: 00afad399737652b3e17257c70a19f62e37f3c97
Data SHA1: b5d3531acaa6a7215899662bb6c1d1d549d834d2
Metadata: Tag='GDDD' Index=0 Length=33 bytes
CYLS:490,HEADS:4,SECS:32,BPS:512.
Metadata: Tag='IDNT' Index=0 Length=512 bytes
..........@. ....... 1145710G06D42314......AH D.231aSDnsi
CHDMan dumpmeta [v0.147u3]
Code:
D:\>chdman-0.147u3 dumpmeta -i "a29a02.chd" -o "a29a02 [-t IDNT -ix 0]" -t IDNT -ix 0
chdman - MAME Compressed Hunks of Data (CHD) manager 0.147u3 (Nov 19 2012)
File (a29a02 [-t IDNT -ix 0]) written, 512 bytes
CHDMan delmeta [v0.147u3]
Code:
D:\>chdman-0.147u3 delmeta -i "a29a02.chd" -t IDNT -ix 0
chdman - MAME Compressed Hunks of Data (CHD) manager 0.147u3 (Nov 19 2012)
Error opening CHD file (a29a02.chd): file not writeable
CHDMan addmeta [v0.147u3]
Code:
D:\>chdman-0.147u3 addmeta -i "a29a02.chd" -t IDNT -ix 0 -vf "a29a02 [-t IDNT -ix 0]"
chdman - MAME Compressed Hunks of Data (CHD) manager 0.147u3 (Nov 19 2012)
Error opening CHD file (a29a02.chd): file not writeable
In order to complete this, I have to use CHDMan from MAME 0.146 release for these two commands to work successfully.
CHDMan delmeta [v0.146]
Code:
D:\>chdman-0.146 delmeta -i "a29a02.chd" -t IDNT -ix 0
chdman - MAME Compressed Hunks of Data (CHD) manager 0.146 (May 21 2012)
Input file: a29a02.chd
Tag: IDNT
Index: 0
Metadata removed
CHDMan info [v0.146]
Code:
D:\>chdman-0.146 info -i "a29a02.chd"
chdman - MAME Compressed Hunks of Data (CHD) manager 0.146 (May 21 2012)
Input file: a29a02.chd
File Version: 5
Logical size: 32,112,640 bytes
Hunk Size: 4,096 bytes
Total Hunks: 7,840
Unit Size: 512 bytes
Total Units: 62,720
Compression: lzma (LZMA), zlib (Deflate), huff (Huffman), flac (FLAC)
CHD size: 16,153,397 bytes
Ratio: 50.3%
SHA1: 00afad399737652b3e17257c70a19f62e37f3c97
Data SHA1: b5d3531acaa6a7215899662bb6c1d1d549d834d2
Metadata: Tag='GDDD' Index=0 Length=33 bytes
CYLS:490,HEADS:4,SECS:32,BPS:512.
CHDMan addmeta [v0.146]
Code:
D:\>chdman-0.146 addmeta -i "a29a02.chd" -t IDNT -ix 0 -vf "a29a02 [-t IDNT -ix 0]"
chdman - MAME Compressed Hunks of Data (CHD) manager 0.146 (May 21 2012)
Input file: a29a02.chd
Tag: IDNT
Index: 0
Data: a29a02 [-t IDNT -ix 0] (512 bytes)
Metadata added
CHDMan info [v0.146]
Code:
D:\>chdman-0.146 info -i "a29a02.chd"
chdman - MAME Compressed Hunks of Data (CHD) manager 0.146 (May 21 2012)
Input file: a29a02.chd
File Version: 5
Logical size: 32,112,640 bytes
Hunk Size: 4,096 bytes
Total Hunks: 7,840
Unit Size: 512 bytes
Total Units: 62,720
Compression: lzma (LZMA), zlib (Deflate), huff (Huffman), flac (FLAC)
CHD size: 16,153,925 bytes
Ratio: 50.3%
SHA1: 00afad399737652b3e17257c70a19f62e37f3c97
Data SHA1: b5d3531acaa6a7215899662bb6c1d1d549d834d2
Metadata: Tag='GDDD' Index=0 Length=33 bytes
CYLS:490,HEADS:4,SECS:32,BPS:512.
Metadata: Tag='IDNT' Index=0 Length=512 bytes
..........@. ....... 1145710G06D42314......AH D.231aSDnsi
P.S. Writeable is spelled wrong.
Code:
writeable = writable
Edit: After comparing the original CHD with the CHD I used delmeta on through a hex editor, there is only one byte difference. Comparing the original CHD with the CHD I used addmeta on through a hex editor, a few bytes has changed in the header. The new meta data is now appended at the end of the file. This causes an increase in the CHD file size. Is this suppose to happen?
Edited by KingTut (12/07/12 03:39 AM)