Dear @Zeaede
cdifile.exe is compatible with chdman up to version 0.138 (included). From version 0.139 up to 0.145, you'll get this error message: "ERROR Unknown track type []. Contact MAMEDEV.". And from version 0.146 up to latest one (0.240), you'll get this other error message: "Error running chdman!".
So, to sum up: use cdifile.exe along with chdman.exe from MAME 0.138 or below (I haven't tried chdman prior version 0.109).
The command line is:
cdifile "mspacman.cdi" -createcd
Last but not least, one important thing to note: if you use a very old version of chdman (as 0.109), the name of input cdifile must not contain spaces or special characters. But using version 0.138 (latest compatible version), you won't have this issue (provided you write the name between " "). Example:
cdifile "Sonic Adventure 2 (USA)[DCRES].cdi" -createcd
(that command will run just fine with cdifile v0.5.1 and chdman v0.138, all in the same folder; but if you use chdman 0.109 instead, it won't)
Any other doubt, just reply!
Regards,
Gabriel