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

 
 

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

Submitted by:  Alois Schlögl <schloegl>
Submitted on:  Mon 20 Sep 2010 03:33:24 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project 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>
Project 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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 21 Sep 2010 12:40:31 AM UTCjweStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1