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

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

[Octave-bug-tracker] [bug #31455] fread is broken


From: Christopher Friedt
Subject: [Octave-bug-tracker] [bug #31455] fread is broken
Date: Tue, 26 Oct 2010 02:42:36 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.41 Safari/534.7

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

                 Summary: fread is broken
                 Project: GNU Octave
            Submitted by: cfriedt
            Submitted on: Tue 26 Oct 2010 02:42:35 AM GMT
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Christopher Friedt
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.2.4
        Operating System: GNU/Linux

    _______________________________________________________

Details:

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





    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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