EMULAB Forum

clrmamepro [English] => clrmame Discussion => Topic started by: Tonioto on 04 August 2015, 22:24

Title: Dir2Dat issue with game names ending with a dot character
Post by: Tonioto on 04 August 2015, 22:24
Hi all,

I've recently encountered a problem trying to "Dir2Dat" a GoodPCE romset (v. 1.09a, latest).

e.g.:
<game name="Taito Chase H.Q.">
   <description>Taito Chase H.Q.</description>
      <rom name="Taito Chase H.Q. (J) [o1].pce" size="524288" crc="033e8c4a"/>
      <rom name="Taito Chase H.Q. (J).pce" size="393728" crc="97ff523e"/>
</game>
<game name="Takeda Shingen">
   <description>Takeda Shingen</description>
      <rom name="Takeda Shingen (J) [a1].pce" size="262144" crc="df7af71c"/>
</game>

After a scan, "Taito Chase H.Q." will be considered as wrongly named and clrmame will propose to rename it to "Taito Chase H.Q" (with no dot at the end of the title).

Is there a way to circumvent this behaviour? Possibly by editing manually the dat file?

Thanks for the help.
Title: Re: Dir2Dat issue with game names ending with a dot character
Post by: Roman on 05 August 2015, 05:30
hmmm.....well, the set name is used for the zip/rar/7z file or folder....and cmpro should not automatically remove it...it could be possible that Windows got  a limitation when creating a folder for it or when calling an external program (7z/rar) to pack them....I will have a look
Title: Re: Dir2Dat issue with game names ending with a dot character
Post by: Tonioto on 05 August 2015, 20:29
Thanks for the interest,

You seem to point to the good direction. When clrmame decompress the archive to parse its content, Windows OS removes the final dot at the end of the temporarily created folder.

e.g.: try to create a folder ending with a dot, Windows will remove it automatically.

I'll try to found a workaround but i'm not confident as it is for sure a file system limitation.

Thanks again.
Title: Re: Dir2Dat issue with game names ending with a dot character
Post by: Roman on 07 August 2015, 19:35
there are most likely other not allowed characters, too (\ /<>|*?)....maybe I filter them out in the future...but I think it's not that hard to handle it manually at the moment
Title: Re: Dir2Dat issue with game names ending with a dot character
Post by: Tonioto on 07 August 2015, 21:03
Thanks for your time and effort.

Do you have a hint for the manual editing?
I've tried to replace the trailing dot with xml encoded character (&#46;) in the dat file to no luck.
Title: Re: Dir2Dat issue with game names ending with a dot character
Post by: Roman on 08 August 2015, 12:30
Replacing would not help...you need to remove it from the dat......there might be a chance that it would work with archives (e.g. "Taito Chase H.Q..zip") but as soon as cmpro creates a temporary folder you most likely run into trouble...
I can have a look at this again next week.
Title: Re: Dir2Dat issue with game names ending with a dot character
Post by: Tonioto on 08 August 2015, 20:37
That's the conclusion I came to.
clrmamepro should parse the actual archive's name, not its temporarily created folder for checking names.
Take no offense, your tool is actually the best and perform exactly what it is designed for.
I just wanted to use it on a wider range of applications, like making dat lists of miscellaneous archives.
I understand that's it is not its main purpose.

Grazie mille.
Title: Re: Dir2Dat issue with game names ending with a dot character
Post by: Roman on 20 August 2015, 19:50
hmm...while looking into this again, I found out that cmpro already does some character cleaning on all possible file names (so set name, rom files, sample files etc..)
It replaces :\/><|*?" with - and it also removes a dot (.) at the end of a (file)name.

So your reported behaviour (Taito Chase H.Q. in the dat gets renamed to Taito Chase H.Q (without the dot at the end)) is actually normal and intended.