Date: Sun, 5 Nov 1995 08:27:40 +0200 (IST) From: Eli Zaretskii To: "Alexander V. Lukyanov" 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.