I had some massive problems with OgreDeflate under Windows 7.
At line 118 it creates a temporary file by using std::tmpname(). tmpname() will retrun something like "/s03g.". But in windows / is the disk volume root directory. When running Ogre from my D: partition Deflate could create temporary files, but could not delete them. When running Ogre from C: Windows blocked creating files in C:/ generally and my app crashed.
My workaround was to add the following:
Code: Select all
117 // Write to temp file
118 char tmpname[L_tmpnam];
119 tmpnam(tmpname);
120 #ifdef _WIN32
121 if(tmpname[0] == '\\')
122 {
123 for(int i = 1; i < L_tmpnam; i++)
124 {
125 tmpname[i - 1] = tmpname[i];
126 }
127 tmpname[L_tmpnam - 1] = -52;
128 }
129 #endif
130 mTempFileName = tmpname;
131 std::fstream *f = OGRE_NEW_T(std::fstream, MEMCATEGORY_GENERAL)();
132 f->open(tmpname, std::ios::binary | std::ios::out);
133 ...
My suggestion is to add a possibility to specify a path for the temporary files. If you work a lot with deflate you could than use a RAM-disk e.g.
Best wishes
Ralf