[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #58055] ftell() incorrect on MS Windows platfo
From: |
John W. Eaton |
Subject: |
[Octave-bug-tracker] [bug #58055] ftell() incorrect on MS Windows platforms if file is not encoded with CRLF line endings |
Date: |
Thu, 9 Apr 2020 15:26:44 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0 |
Follow-up Comment #13, bug #58055 (project octave):
OK, looking again, I see that if you are just using fseek with SEEK_SET to
return to a position returned by ftell, it should work, even in text mode.
If you do something like
fid = fopen ("some_file", "rt");
k = 0;
while (k++ < 100)
c = fread (fid, 1);
if (c < 0) break; endif
printf ("%d: %d\n", ftell (fid), c);
endwhile
on a Windows system when "some_file" uses LF line-endings, does the file
position returned by ftell jump by 2 when the LF character (ASCII 10) is
read?
Or is the incorrect count just a problem when using fgetl/fgets to read the
file?
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?58055>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #58055] fgetl() reads in beyond newline according to following ftell(), Rik, 2020/04/07
- [Octave-bug-tracker] [bug #58055] fgetl() reads in beyond newline according to following ftell(), Toby, 2020/04/09
- [Octave-bug-tracker] [bug #58055] fgetl() reads in beyond newline according to following ftell(), Toby, 2020/04/09
- [Octave-bug-tracker] [bug #58055] ftell() incorrect on MS Windows platforms if file is not encoded with CRLF line endings, Rik, 2020/04/09
- [Octave-bug-tracker] [bug #58055] ftell() incorrect on MS Windows platforms if file is not encoded with CRLF line endings, John W. Eaton, 2020/04/09
- [Octave-bug-tracker] [bug #58055] ftell() incorrect on MS Windows platforms if file is not encoded with CRLF line endings,
John W. Eaton <=
- [Octave-bug-tracker] [bug #58055] ftell() incorrect on MS Windows platforms if file is not encoded with CRLF line endings, Rik, 2020/04/09
- [Octave-bug-tracker] [bug #58055] ftell() incorrect on MS Windows platforms if file is not encoded with CRLF line endings, John W. Eaton, 2020/04/10
- [Octave-bug-tracker] [bug #58055] ftell() incorrect on MS Windows platforms if file is not encoded with CRLF line endings, Rik, 2020/04/10
- [Octave-bug-tracker] [bug #58055] ftell() incorrect on MS Windows platforms if file is not encoded with CRLF line endings, John W. Eaton, 2020/04/11
- [Octave-bug-tracker] [bug #58055] ftell() incorrect on MS Windows platforms if file is not encoded with CRLF line endings, Markus Mützel, 2020/04/11
- [Octave-bug-tracker] [bug #58055] ftell() incorrect on MS Windows platforms if file is not encoded with CRLF line endings, John W. Eaton, 2020/04/13
- [Octave-bug-tracker] [bug #58055] ftell() incorrect on MS Windows platforms if file is not encoded with CRLF line endings, John W. Eaton, 2020/04/14
- [Octave-bug-tracker] [bug #58055] ftell() incorrect on MS Windows platforms if file is not encoded with CRLF line endings, John W. Eaton, 2020/04/15
- [Octave-bug-tracker] [bug #58055] ftell() incorrect on MS Windows platforms if file is not encoded with CRLF line endings, Markus Mützel, 2020/04/15
- [Octave-bug-tracker] [bug #58055] ftell() incorrect on MS Windows platforms if file is not encoded with CRLF line endings, John W. Eaton, 2020/04/15