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

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

[Octave-bug-tracker] [bug #35852] fscanf does not read full file


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #35852] fscanf does not read full file
Date: Tue, 12 Jun 2012 16:41:29 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.4) Gecko/20100101 Firefox/10.0.4 Iceweasel/10.0.4

Follow-up Comment #24, bug #35852 (project octave):

I think they only problem areas are in the functions in liboctave/lo-utils.cc
that read doubles and attempt to handle reading "Inf" and "NaN".

I don't know how to write those functions if it is only possible to look one
character ahead in the input stream.  For example, if the input contains
"+Impossible", we have to read "+Im" before we can decide that this doesn't
match "+Inf".  Then we should fail, but the stream read pointer should be left
pointing at the "+".  Do you have some ideas about how to do that with
single-character lookahead?  Or maybe I'm misunderstanding the problem.

Yes, we already use a custom stream class.  As I recall, we do that so we can
implement Matlab-compatible fseek and ftell functions and perhaps some other
stdio-style functions for the Octave interpreter.  If we modify those stream
functions to handle buffering for arbitrary lookahead (or even just a fixed
limit large enough for Octave's needs) and then expect the functions in
lo-utils.cc to depend on that buffering behavior, we would need to change them
so that they take the special octave stream type as an argument instead of a
generic istream.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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