bugGNU Octave - Bugs: bug #31085, fopen(f,'wz') broken ?

 
 

bug #31085: fopen(f,'wz') broken ?

Submitter:  Alois Schlögl <schloegl>
Submitted:  Mon 20 Sep 2010 03:33:24 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 21 Sep 2010 07:51:57 AM UTC, comment #3: 

Oops.  The following change should restore that behavior:

  http://hg.savannah.gnu.org/hgweb/octave/rev/ffe58182db89

Thanks.

John W. Eaton <jwe>
Group administrator
Tue 21 Sep 2010 07:26:25 AM UTC, comment #2: 

This patch breaks this command;

octave:4> fprintf(1,'abc\n')
error: fprintf: invalid stream number = 1


Alois


Alois Schlögl <schloegl>
Tue 21 Sep 2010 12:40:31 AM UTC, comment #1: 

I checked in the following changeset:

  http://hg.savannah.gnu.org/hgweb/octave/rev/594adb99a25e

John W. Eaton <jwe>
Group administrator
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






Alois Schlögl <schloegl>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by schloegl (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-09-21 jwe StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code