[Scummvm-devel] mkdir SAVEPATH or not? And when?

Max Horn max at quendi.de
Sun Jan 21 11:03:42 CET 2007


Hi folks,

recently I was thinking a bit about how to resolve the issue  
described in this tracker item: <https://sourceforge.net/tracker/ 
index.php?func=detail&aid=1504398&group_id=37116&atid=418820>.

Roughly said, on Mac OS X, at some point we chose "~/Documents/ 
ScummVM Savegames" to be the default savedir. Problem is, that path  
doesn't always exist, so blindly using it will cause save errors for  
the unaware users, which is highly disturbing...

So, a workaround was added (also affecting all other UNIX system): In  
registerDefaults, we mkdir the DEFAULT_SAVE_PATH. The big drawback of  
that is that this means we *always* create the default savedir, even  
if the user changed it to something different. Hence, that workaround  
is bad and I will remove it in its current form.


What are the alternatives? Well I believe we should still mkdir the  
savepath, if possible. That's the most convenient solution for end  
users, and what other programs do (I believe). I just would suggest  
doing it in a different place: Namely right before storing a  
savegame. That avoids other issues, too, like the user deleting the  
savegame dir while ScummVM is running (a not-so-unlikely scenario,  
actually, if you think a bit about it and consider that people can  
play in windowed mode).


So the best place to but it appears (to me) to be the (Default) 
SaveFileManager. As such it would seem best to move  the relevant  
mkdir code (still with the "#ifdef UNIX") to  
DefaultSaveFileManager::openForSaving().

Any comment / thoughts on this?

Bye,
Max





More information about the Scummvm-devel mailing list