bugGNU Octave - Bugs: bug #47671, textscan re-reads part of the file...

 
 

bug #47671: textscan re-reads part of the file on the second and subsequent calls

Submitted by:  Lachlan Andrew <lachlan>
Submitted on:  Tue 12 Apr 2016 11:05:23 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: Lachlan Andrew <lachlan>
Originator Name: LachlanOpen/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 14 Apr 2016 12:05:40 AM UTC, comment #3:

I applied your patch here http://hg.savannah.gnu.org/hgweb/octave/rev/fe0a6de805e4. Closing report.

Rik <rik5>
Project Administrator
Wed 13 Apr 2016 10:11:44 AM UTC, comment #2:

I forgot to add steps to reproduce the problem.

Type

The ftell reports 3, even though 8 characters have been processed.

This is separate from bug #41579 ("textscan: file offset after partial read differs from Matlab"). Matlab returns 7 instead of 8 for some reason.

Lachlan Andrew <lachlan>
Project MemberIn charge of this item.
Tue 12 Apr 2016 11:07:31 AM UTC, comment #1:

The attached patch seems to fix the problem, by keeping better track of the number of bytes processed.

(file #36900)

Lachlan Andrew <lachlan>
Project MemberIn charge of this item.
Tue 12 Apr 2016 11:05:23 AM UTC, original submission:

When textscan reads only part of a file, the read pointer is left at the wrong position, so that subsequent reads re-read some of the data.

In some circumstances, this can also result in the EOF flag not getting set when the whole file has been read.

Lachlan Andrew <lachlan>
Project MemberIn charge of this item.

 

(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

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by lachlan (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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 14 Apr 2016 12:05:40 AM UTCrik5StatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Tue 12 Apr 2016 11:07:31 AM UTClachlanAttached File-=>Added bug_47671_textscan_file_pos.cset, #36900
      StatusNone=>Patch Submitted
      Assigned toNone=>lachlan
      Releaseother=>dev

    Back to the top


    Powered by Savane 3.1-cleanup1