The NEW Build Your Own Arcade Controls

Front End Support => MaLa Frontend => Topic started by: ChrisK on March 18, 2012, 10:32:53 pm

Title: Changing drive letters in game lists
Post by: ChrisK on March 18, 2012, 10:32:53 pm
I'm switching PCs in my cabinet and on the new computer I have all my stuff on a different hard drive.  I went through Mala and changed all the paths to point from C: to E:, but it seems all my Mala game lists have the full path in each ROM name, including the drive letter.  I don't see a way to change this in a batch, so it appears all my game lists are now non-functional.

Does anyone know how I might edit all my game lists to change the ROM paths from C: to E: in an automated fashion?  I have way too many list entries to do it one-by-one manually, and it doesn't seem the file format is text-based, where I could just go in with a text replace tool.
Title: Re: Changing drive letters in game lists
Post by: NOP on March 19, 2012, 09:30:09 am
if all you're doing is changing C: to E: in your lists, then a binary search+replace tool would do the job.
something like this maybe:
http://www.funduc.com/srbinary1.htm (http://www.funduc.com/srbinary1.htm)


If you have different paths on C: as you do on E:, then you are likely screwed, unless your new path is the same length.

Make backups first! 
Title: Re: Changing drive letters in game lists
Post by: ChrisK on March 19, 2012, 02:52:51 pm
Ah, I didn't consider that the C: might not be encoded in the binary files.  I only noticed that they weren't text and moved on.

I'll give that a shot.  Thanks for the suggestion!
Title: Re: Changing drive letters in game lists
Post by: NOP on March 20, 2012, 09:07:18 am
C: should be in there, I was just trying to say if you wanted to change from:

C:\mala\mame\roms

to

e:\documents and settings\mame\roms

you'd be screwed because the length of the path itself is different, and you can't just insert additional data inside a binary file.

Title: Re: Changing drive letters in game lists
Post by: ChrisK on March 20, 2012, 09:12:04 am
Thankfully all I needed to do was change c:\roms\mame to e:\roms\mame, so the single byte replace you suggested worked perfect!  I did it last night and tested all the lists; no problems.

Thanks for the suggestion, you saved me a TON of time rebuilding lists!
Title: Re: Changing drive letters in game lists
Post by: nexusmtz on March 23, 2012, 01:26:23 am
The other way to solve this (if C: is formatted with NTFS) is to create a junction using Junction (http://technet.microsoft.com/en-us/sysinternals/bb896768)

c:\downloads\junction.exe c:\mala\mame\roms "e:\documents and settings\mame\roms"

Junctions cause your computer to be redirected from one directory to another, e.g. the roms directory on C: to the roms directory on E:

Advantage - no programs or configuration files have to be changed. It just works.

Disadvantage - c:\mala\mame\roms can't have it's own content and be a junction over to e: (junctions wouldn't 'combine' the two)
Disadvantage - Junctions are notextra copies. They're more like a detour sign. Although Explorer will think that c: and e: both have 30GB of roms; if you delete a file from either, it's gone.
Title: Re: Changing drive letters in game lists
Post by: ChrisK on March 23, 2012, 08:09:32 am
Every time I come across a good use for NTFS junction points I get nervous and back away.  I've used symlinks on Linux and OSX and like the concept, I guess I just have a prejudice against them in Windows because of my former nightmares using SUBST.  Totally unfair, I know.  I really need to get familiar with junction points before I need it at work and the other guys see the fear in my eyes.  :)
Title: Re: Changing drive letters in game lists
Post by: nexusmtz on March 24, 2012, 02:59:35 pm
...get familiar with junction points before I need it at work...

They're great at work for bailing people out of tight spots. Someone's out of space because they put their app's data directories on C:? Move them to the data drive (which is probably sitting there empty) or a new volume, and add the reparse point. It's a crutch, but it's better than having an outage.

At home, I use them to shuffle things (usually games) on and off of my SSD depending on what I'm 'into' that week/month. They also let me boot from different drives, but still have my c:\games and c:\util directories available from each OS.

Hard links aren't usually needed at home, but you can do those too... Wouldn't you be popular if you could seed multiple versions of a library from just the space of your latest one and the differences?

So don't be afraid. Just be careful.