From bug-octave-request at bevo dot che dot wisc dot edu Fri Nov 13 07:29:26 1998 Subject: Re: Octave v2.1.10 fread bug From: William D Kirby To: "John W. Eaton" CC: "Report, Bug" Date: Fri, 13 Nov 1998 08:27:41 -0500 Your patch fixed the reported problem. Thanks BTW: I had to add the following items to "makeconf" to add glob info that configure (Cygwin beta20) did not include. # cc and associated flags. DLFCN_INCFLAGS = GLOB_INCFLAGS = -I$(TOPDIR)/glob LIBCRUFT = $(TOPDIR)/libcruft/libcruft.$(LIBEXT) LIBGLOB = $(TOPDIR)/glob/libglob.$(LIBEXT) SPECIAL_MATH_LIB = "John W. Eaton" wrote: > On 12-Nov-1998, William D Kirby wrote: > > | I had an m file that ran fine with version 2.0.13 that read a binary > | data file with 80,000 16 bit ints with the following script > | > | num = fopen("test.pcm","rb"); > | [x, c] = fread(num, inf, "short"); > | > | Version 2.1.10 reads in x with a size of 131072x1. The first 80,000 > | values are correct, but the additional data are zero. The following is > | required to get the exact 80,000 data samples needed. > | > | num = fopen("test.pcm","rb"); > | [x, c] = fread(num, 80000, "short"); > | > | Shouldn't the "inf" notation read only to an end of file? > > Yes. Please try the following patch. > > Thanks, > > jwe > > Thu Nov 12 17:44:15 1998 John W. Eaton > > * dMatrix.cc (Matrix::read): Do the right thing for EOF when > amount of data to read is unspecified. > > Index: dMatrix.cc > =================================================================== > RCS file: /home/jwe/src/master/octave/liboctave/dMatrix.cc,v > retrieving revision 1.60 > diff -c -r1.60 dMatrix.cc > *** dMatrix.cc 1998/09/26 02:45:57 1.60 > --- dMatrix.cc 1998/11/12 23:43:56 > *************** > *** 2617,2623 **** > if (ok && skip != 0) > is.seekg (skip, ios::cur); > > ! if (! ok) > { > if (is.eof ()) > { > --- 2617,2623 ---- > if (ok && skip != 0) > is.seekg (skip, ios::cur); > > ! if (! ok || is.eof ()) > { > if (is.eof ()) > { -- William D. Kirby Voice: (703) 273-0005 Consultant Email: wdkirby at ix dot netcom dot com 3527 Cornell Road Fairfax, VA 22030-1813