Recent

Author Topic: EOLn in doc, and on Linux/Windows  (Read 2245 times)

ghr

  • New member
  • *
  • Posts: 9
EOLn in doc, and on Linux/Windows
« on: October 29, 2016, 05:11:07 pm »
Recently (well..) I ported a program from Windows to Linux, using fpc 2.6.4. in both cases. It seems to me that handling eof and eoln differs over the two platforms.

Let us start with the eoln doc: I get it from here: http://www.freepascal.org/docs-html/rtl/system/eoln.html, and it says: "Eof returns True if the file pointer has reached the end of a line, which is demarcated by a line-feed character (ASCII value 10), or if the end of the file is reached. In all other cases Eof returns False. If no file F is specified, standard input is assumed. It can only be used on files of type Text."

So the description is clear (apart from using eof which should have been eoln): an eof implies an eoln. This seems to match what I get on linux, but NOT what I get on windows..... In both cases I use "native" text files, with eoln implementation being CRLF (win) or LF only (linux). Any comments welcome; plus a correction on the eoln page.
 

Handoko

  • Hero Member
  • *****
  • Posts: 5158
  • My goal: build my own game engine using Lazarus
Re: EOLn in doc, and on Linux/Windows
« Reply #1 on: October 29, 2016, 05:22:20 pm »

ghr

  • New member
  • *
  • Posts: 9
Re: EOLn in doc, and on Linux/Windows
« Reply #2 on: October 30, 2016, 02:23:12 pm »
Handoko thank you (again), both are helpful, in the mean time I will re-check my findings....

 

TinyPortal © 2005-2018