http://bugs.openzim.org/show_bug.cgi?id=19
Summary: Windows+MSVisualStudio: Zimlib is unable to deal with ZIM files larger than 2GB Product: openZIM Version: unspecified Platform: PC OS/Version: Windows Status: NEW Severity: blocker Priority: P1 Component: zimlib AssignedTo: tommi@tntnet.org ReportedBy: emmanuel@engelhart.org CC: dev-l@openzim.org Estimated Hours: 0.0
Compiling zimlib under Windows with Visual Studio works and it runs well. But only as long you have "small" zim files because the zimlib fails to deal with large files (>2GB). The root cause is the seekg() in fileimpl.cpp just before reading the cluster.
http://svn.openzim.org/viewvc.cgi/trunk/zimlib/src/fileimpl.cpp?revision=306...
zimFile.seekg(clusterOffset); zimFile >> cluster;
If the required cluster is over the 2GB limit then the seekg() does not go to the right offset and the decompression fails.
Until now I have no solution/workaround. Ideas?
http://bugs.openzim.org/show_bug.cgi?id=19
--- Comment #1 from Emmanuel Engelhart emmanuel@engelhart.org 2010-03-26 11:52:25 CET --- I have to say something trivial... but this is essential... this occurs (probably) only on 32 bits Windows with a 32 bits binary compilation.
http://bugs.openzim.org/show_bug.cgi?id=19
Asaf Bartov asaf.bartov@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |asaf.bartov@gmail.com
--- Comment #2 from Asaf Bartov asaf.bartov@gmail.com 2010-03-26 12:13:15 CET --- Yes, it is a known limitation of the iostream implementation in 32-bit Windows. The workaround are to either use direct Win32 API (e.g. SetFilePointer() instead of seekg()), or to use the lower-level CRT function _lseek().
Both would require wrapping the I/O functions used by zimlib to avoid constant #ifdef clauses.
http://bugs.openzim.org/show_bug.cgi?id=19
--- Comment #3 from Emmanuel Engelhart emmanuel@engelhart.org 2010-03-27 13:23:13 CET --- Tntnet proposed to reimplement an own iostream class(set) to replace ifstream. This class(set) would use low level functions, be portable and not suffer of any 32 bits limitation. This should also give us a chance to improve (again) the whole zimlib performance.
http://bugs.openzim.org/show_bug.cgi?id=19
--- Comment #4 from Emmanuel Engelhart emmanuel@engelhart.org 2010-04-22 17:06:31 CET --- So if the last fixes listed in this following email were commited to the SVN https://intern.openzim.org/pipermail/dev-l/2010-April/000398.html
... the zimlib should be 100% compatible with MS Windows cl.exe compiler and the 2GB bug fixed.
http://bugs.openzim.org/show_bug.cgi?id=19
Tommi Mäkitalo tommi@tntnet.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED