www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/11/05/01:44:16

Date: Sun, 5 Nov 1995 08:27:40 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "Alexander V. Lukyanov" <lav AT yars DOT free DOT net>
Cc: kagel AT ts1 DOT bloomberg DOT com, djgpp AT sun DOT soe DOT clarkson DOT edu,
jkmarsha AT socs DOT uts DOT edu DOT au
Subject: Re: CR/LF pairs... NO NO NO!

On Thu, 2 Nov 1995, Alexander V. Lukyanov wrote:

>    The so called text mode works fine until using fseek/ftell. I saw
> the bug in Borland C 2,3,4. I didn't test it on gcc, but I'm sure,
> that it is there in many other compilers.

fseek()/ftell() are NOT the portable method of random access to files.  
These functions aren't even ANSI.  If you want portability, use fgetpos() 
and fsetpos().

Btw, fseek()/ftell() will also work, if you only call fseek() with values 
returned by ftell(), and not with values produced through arithmetics on
byte offsets.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019