octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Octave + ZLIB + Win32


From: michael . goffioul
Subject: Octave + ZLIB + Win32
Date: Thu, 07 Dec 2006 17:17:24 +0100

Hi,
 
This is a little bit off-topic, but maybe I can get some good advices. I'm trying
to integrate ZLIB within my octave under MSVC, however I found that the
generated compressed MAT files (save -z -text ...) were corrupted. I tracked
down the problem until I found I could reproduce corruption outside octave
with a program as simple as:
 
#include <zlib.h>
int main(int argc, char **argv)
{
 gzFile *f = gzopen("test1.txt.gz", "w");
 char buf[32];
 int i;
 for (i=1; i<125; i++)
 {
  sprintf(buf, " %d\\n", i);
  gzwrite(f, buf, strlen(buf));
 }
 gzclose(f);
 return 0;
}
 
If I use 100 instead of 125, everything's fine. I tried this with various configuration
under Win32, without success (except when using cygwin):
 
- GnuWin32 zlib package: failure
- zlib-1.2.3 source compiled with MinGW: failure
- zlib-1.2.3 source compiled with MSVC: failure
- zlib-1.2.3 source compiled with Cygwin: success
- zlib-1.2.3 source compiled with gcc under Linux: success
 
To test, I run my test program, then opens the result compressed file with winzip
or tried to decompress it with minigzip (simple tool provided in zlib source tree).
Both report data error.
 
What I would like to know is whether anybody can reproduce this.
 
Thanks,
Michael.
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]