delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/08/23/06:15:43

Date: Fri, 23 Aug 1996 14:10:31 +0400 (MSD)
From: "Alexander V. Lukyanov" <lav AT video DOT yars DOT free DOT net>
Message-Id: <199608231010.OAA15621@video.yars.free.net>
To: eliz AT is DOT elta DOT co DOT il, jack AT st DOT rim DOT or DOT jp
Cc: dj AT delorie DOT com, djgpp-workers AT delorie DOT com
Subject: Re: CR/LF conversion

> On Fri, 23 Aug 1996, =?ISO-2022-JP?B?GyRCQEQ7M0JnMnAbKEI=?= /Daisuke Aoyama wrote:
> 
> >   after `read (fh,buf,3)', it returns 3 and seek at 3
> >   after `read (fh,buf,4)', it returns 3 and seek at 4 but delete '\r'
> > 
> > It separates CR from LF. So I cannot found the difference from BUF
> > and cannot seek backward easily.
> 
> I think this inconsistency between `read' and `fseek' should be corrected 
> in the alpha release of the C library.

Relative seek is not quite supported on text-open files. ANSI says so,
if I'm not mistaken. So it is nothing to complain, IMHO. And, btw,
read and fseek don't have anything common.

Deleting CR before seeing LF is simpler and probably faster than
reading ahead and checking. Text files are not supposed to contain CR
alone.

- Raw text -


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