[Top][All Lists]

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

[Octave-patch-tracker] [patch #8783] C++ implementation of textscan

From: Lachlan Andrew
Subject: [Octave-patch-tracker] [patch #8783] C++ implementation of textscan
Date: Thu, 11 Feb 2016 12:46:33 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Follow-up Comment #40, patch #8783 (project octave):

It is impossible to have a completely stand-alone version -- at least without
terrible inefficiency.

Consider a file containing the string "0.1234+0.1234i 0", and the sequence of

textscan (fd, "%f", 1);
textscan (fd, "%f", 1);

The first reads only a single number (the complex one) and the second reads

Now consider that the "i" is absent from the file.  The first read should
return 0.1234 and the second should also return 0.1234.  To do that,  textscan
 must leave the file's read position at the "+" sign, but it had to read ahead
until the "i" (or subsequent space) to decide whether or not to stop there.

Unless we can seek backwards (which Octave currently disallows), the only way
we can implement that is to count how many characters we have read, close the
file, and re-read the appropriate number of characters.

I use textscan on a 60GB file.  Re-reading the entire file after each call is
not an option...

For the moment, let's wait for our kind OSX testers to see how this works. 
Let me know what you'd like me to do w.r.t. the dbstop issues.  I'll try to
give MXE a go over the weekend.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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