problem with feof() function in octave 1.1

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

problem with feof() function in octave 1.1

Vinayak Dutt
hi:

i was trying to use feof() function to test end-of-file condition in the new octave 1.1
when i get error message:

octave:15> err = feof(f)
error: range error
error: invalid conversion from <unknown type> to real scalar
error: inapproriate file specifier
error: evaluating index expression near line 15, column 11
error: evaluating assignment expression near line 15, column 5

here f is the file opened with fopen().

--vinayak-
/*
 * vinayak dutt
 * graduate student, ultrasound research
 * mayo graduate school, rochester mn
 *
 * e-mail: [hidden email]
 *         [hidden email]
 *
 */
#include "disclaimer.h"

Reply | Threaded
Open this post in threaded view
|

Re: problem with feof() function in octave 1.1

John Eaton-4
[hidden email] (Vinayak Dutt) wrote:

: i was trying to use feof() function to test end-of-file condition in
: the new octave 1.1 when i get error message:
:
: octave:15> err = feof(f)
: error: range error
: error: invalid conversion from <unknown type> to real scalar
: error: inapproriate file specifier
: error: evaluating index expression near line 15, column 11
: error: evaluating assignment expression near line 15, column 5
:
: here f is the file opened with fopen().

This has been fixed for 1.1.1.  Here is a patch:


Thu Jan 19 08:33:50 1995  John Eaton  <[hidden email]>

        * src/file-io.cc (feof_internal): Use args(0), not args(1).


*** src/file-io.cc~ 1995/01/04 04:05:12
--- src/file-io.cc 1995/01/19 15:07:59
***************
*** 1773,1779 ****
    Octave_object retval;
 
  // Get file info.
!   Pix p = return_valid_file (args(1));
 
    if (! p)
      return retval;
--- 1773,1779 ----
    Octave_object retval;
 
  // Get file info.
!   Pix p = return_valid_file (args(0));
 
    if (! p)
      return retval;



BTW, it's probably best to send bug reports to bug-octave instead of
help-octave.

Thanks,

jwe