bugGNU Octave - Bugs: bug #31455, fread is broken

 
 

bug #31455: fread is broken

Submitted by:  Christopher Friedt <cfriedt>
Submitted on:  Tue 26 Oct 2010 02:42:35 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: InvalidAssigned to: None
Originator Name: Christopher FriedtOpen/Closed: Closed
Release: 3.2.4Operating 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 26 Oct 2010 02:47:57 AM UTC, comment #1:

nevermind, user error :P

should be size(V)

Christopher Friedt <cfriedt>
Tue 26 Oct 2010 02:42:35 AM UTC, original submission:

The size of a matrix / vector is incorrectly reported after it is created with fread. Ubuntu 10.10, i686-pc-linux-gnu.

$ dd if=/dev/urandom of=bytes.dat bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.000483732 s, 1.1 MB/s

$ cat dobytes.m
fn='bytes.dat';
fid=fopen(fn,'r');
[V,len]=fread(fid);
% len correctly reports 512
len
% should return [512 1], but returns [1 1]
size V
% size correctly reported with whos
whos V
% uncomment the next line to examine the data; its all there
% V(1:512,:)
fclose(fid);

$ octave -q dobytes.m
len = 512
ans =

1 1

Variables in the current scope:

Attr Name Size Bytes Class
==== ==== ==== ===== =====
V 512x1 4096 double

Total is 512 elements using 4096 bytes

Christopher Friedt <cfriedt>

 

(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 (Updated the item)
  • -unavailable- added by cfriedt (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 26 Oct 2010 03:25:04 AM UTCjweStatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1