On 9/7/08, Dennis Schridde <[EMAIL PROTECTED]> wrote: > > On Sunday 07 September 2008 23:01:08 bugs buggy wrote: > > Ok, the issue is, that we open the music file. (in base/music). > > Then we want to remove base, since we are going to play a MP game. > > But we can't since we still have a open file handle. > > This leaves it in the physfs search path, and causes us issues. > > You mean when we start the game we are in "base" mode? > SearchPath#base > When we then start an MP game we switch to mp mode? > SP#mp > Correct till now? > That causes issues when files from base are still opened when the > searchpath > is removed? > So why dont we just add directories? And before removing any make sure > there > are no open files? > SP#base:mp > The no-open-files part would have to be out of the system itself, I think. > Checking all open files and refusing to unmount (or closing files on > unmount) > doesnt sound very clever. > > --Devu >
Huh? How are you supposed to tell which file is open? All we know is that at least one file handle is open, (in this case, it happens to be the music one) and physfs won't allow it to be removed from the search path (which is correct behavior IMO) so it fails. I am unaware of a way to check just which file(s) we have open unless you keep them in a list. If you want to add all the files/directories in base, one by one, then remove them one by one, checking no file handle is open, that seems to be a overly complex way to handle this. I was thinking of something along the lines of: Warzone Warzone/data Warzone/data/base Warzone/data/mods Warzone/data/mp Warzone/data/music Warzone/data/music/music* There is also a configdir/music directory (which overrides the other music folder) which needs to be removed, unless, we will allow sharing of music tracks between people? AFAIK, this is left over behaviour from before, and not really needed. The above is what my patch does, and I did test it, and it works. It should also fix bug https://gna.org/bugs/?12280 & https://gna.org/bugs/?11847 patch here: http://developer.wz2100.net/ticket/57 *since the source has 'music' hardcoded (static const char UserMusicPath[] = "music";), rather than changing allot of things around, I did it the simplest way to prove this is the problem.
_______________________________________________ Warzone-dev mailing list Warzone-dev@gna.org https://mail.gna.org/listinfo/warzone-dev