bugGNU Octave - Bugs: bug #47537, textscan reads entire file even...

 
 

bug #47537: textscan reads entire file even when given a count

Submitted by:  Mike Miller <mtmiller>
Submitted on:  Fri 25 Mar 2016 11:22:42 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: DuplicateAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 28 Mar 2016 05:23:19 PM UTC, comment #2:

Example works now with fix for bug #47517.

Mike Miller <mtmiller>
Project Administrator
Sat 26 Mar 2016 07:22:46 AM UTC, comment #1:

Mike, see bug #47517.

The file isn't read until EOF, as you can see from the size of the return value. The problem is that the patch for seekg() was not committed when the rest of textscan was. Without it, seekg() always returns -1 even if not at EOF. I've attached it again, in case that makes finding it easier.

(file #36764)

Lachlan Andrew <lachlan>
Project Member
Fri 25 Mar 2016 11:22:42 PM UTC, original submission:

When told to read a certain number of elements matching the format specifier and its input is a file descriptor, textscan is supposed to stop reading the input file at the last character that matched a conversion. Instead, the new textscan reads the entire file up to EOF.

Example:

I think in this case the results for both pos and ftell should be 2.

It would be helpful if someone could confirm these in Matlab.

Mike Miller <mtmiller>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -unavailable- added by lachlan (Updated the item)
  • -unavailable- added by mtmiller (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 28 Mar 2016 05:23:19 PM UTCmtmillerOpen/ClosedOpen=>Closed
    Sat 26 Mar 2016 07:22:46 AM UTClachlanAttached File-=>Added textscan_enable_seek_v2.cset, #36764
      StatusNeed Info=>Duplicate
    Fri 25 Mar 2016 11:24:01 PM UTCmtmillerDependencies-=>bugs #41579 is dependent

    Back to the top


    Powered by Savane 3.1-cleanup1