Mon 20 Sep 2010 03:33:24 PM UTC, original submission:
The documentation of fopen() says:
" ...
Additionally, you may append a "z" to the mode string to open a
gzipped file for reading or writing. For this to be successful, you must also open the file in binary mode.
...
"
This feature seems to be broken:
fid = fopen('/tmp/t2.gz','wbz')
fwrite(fid,32+ceil(rand(1000,1)*64),'uint8');
fclose(fid);
results in an
fid = -1
thus, fwrite and fclose do not work. However, a file /tmp/t2.gz with 20 bytes is generated.
This can be observed (ubuntu 10.04, x86_64) with Octave 3.2, and on the latest development 3.3.52+ (built about 7 days ago).
config.log contains (besides others) this
configure:29200: checking zlib.h usability
configure:29200: gcc -c -g -O2 -pthread conftest.c >&5
configure:29200: $? = 0
configure:29200: result: yes
configure:29200: checking zlib.h presence
configure:29200: gcc -E conftest.c
configure:29200: $? = 0
configure:29200: result: yes
configure:29200: checking for zlib.h
configure:29200: result: yes
configure:29216: checking for gzclearerr in -lz
configure:29244: gcc -o conftest -g -O2 -pthread conftest.c -lz -lm >&5
configure:29244: $? = 0
configure:29249: result: yes
and this
Z CPPFLAGS:
Z LDFLAGS:
Z libraries: -lz
Therefore, I assume zlib is correctly included.
Alois
|