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: Kai Torben Ohlhus
Subject: [Octave-bug-tracker] [bug #55577] textscan should reject any single-precision arg as invalid (file-io.cc-tst BIST test failure)
Date: Tue, 29 Jan 2019 04:20:27 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36

Follow-up Comment #11, bug #55577 (project octave):

Answering comment #10 with additions:


>> fid = fopen ('existing-text-file.txt')
fid =

     3
>> class (fid)
ans =

    'double'
>> fopen (fid)          % no output == no 'ans'
>> fopen (double (fid)) % no output == no 'ans'
>> fopen (single (fid))
Error using fopen
First input must be a file name or a file identifier.
>> fopen (int32 (fid))
Error using fopen
First input must be a file name or a file identifier.
>> fopen (int64 (fid))
Error using fopen
First input must be a file name or a file identifier.
>> fopen (uint64 (fid))
Error using fopen
First input must be a file name or a file identifier.
>> fgetl (double (fid))
ans =

    -1
>> fgetl (single (fid))
Error using fgets
Invalid file identifier. Use fopen to generate a valid file identifier.

Error in fgetl (line 32)
[tline,lt] = fgets(fid);
>> fgetl (int32 (fid))
Error using fgets
Invalid file identifier. Use fopen to generate a valid file identifier.

Error in fgetl (line 32)
[tline,lt] = fgets(fid);


Quoting "help fopen" (not the same as the online documentation):

> FID is a scalar MATLAB integer valued double, called a file identifier. You
use FID as the first argument to other file input/output routines, such as
FREAD and FCLOSE. If fopen cannot open the file, it returns -1.

So I think "double" is the only valid file handle data type in Matlab.

    _______________________________________________________

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]