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

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

[Octave-bug-tracker] [bug #55577] textscan should reject any single-prec


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #55577] textscan should reject any single-precision arg as invalid (file-io.cc-tst BIST test failure)
Date: Mon, 28 Jan 2019 15:30:17 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Update of bug #55577 (project octave):

             Open/Closed:                  Closed => Open                   

    _______________________________________________________

Follow-up Comment #10:

Unfortunately, "file handle" is a double precision numeric value.

Or are you saying we should accept any class of numeric value if that value
can be used to access an open file?

What does the following code do in Matlab (based on comment #, I'm guessing it
fails unless the file ID is a double)?


fid = fopen ('existing-text-file')
class (fid)
fopen (fid)
fopen (double (fid))
fopen (single (fid))
fopen (int32 (fid))
fgetl (double (fid))
fgetl (single (fid))
fgetl (int32 (fid))
...


First, does a file ID in Matlab have class "double"?

Second, if passing an intN value to a function like fgetl or fopen works, does
it work for all numeric types?  Or, if it fails, does it fail for all types
other than double?

The above code works in Octave, so at least fopen and fgetl don't seem to care
about the type of the argument as long as the numeric value of the file ID can
be used to find the corresponding internal file object.

If the above code does not work in Matlab, then we could consider breaking
compatibility with older versions of Octave for better compatibility with
Matlab.  But I would prefer to not do that, and to also have consistent
behavior for all functions that work with file IDs.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55577>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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