octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #31085] fopen(f,'wz') broken ?


From: Alois Schlögl
Subject: [Octave-bug-tracker] [bug #31085] fopen(f,'wz') broken ?
Date: Mon, 20 Sep 2010 15:33:25 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100825 Ubuntu/10.04 (lucid) Firefox/3.6.9

URL:
  <http://savannah.gnu.org/bugs/?31085>

                 Summary: fopen(f,'wz') broken ?
                 Project: GNU Octave
            Submitted by: schloegl
            Submitted on: Mon 20 Sep 2010 03:33:24 PM GMT
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:

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 










    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31085>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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