delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/11/24/06:48:22

Date: Mon, 24 Nov 1997 13:47:55 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: DJ Delorie <dj AT delorie DOT com>
cc: djgpp-workers AT delorie DOT com
Subject: Docs changes for lseek and fseek
Message-ID: <Pine.SUN.3.91.971124134646.23713e-100000@is>
MIME-Version: 1.0

Somebody asked for the subtle points of fseek to be documented.  Here:

*** src/libc/ansi/stdio/fseek.t~0	Mon Jul 10 05:39:44 1995
--- src/libc/ansi/stdio/fseek.txh	Sat Nov 22 19:31:16 1997
***************
*** 34,40 ****
  been opened as a text file.  Although this restriction is not enforced,
  beware that there is not a one-to-one correspondence between file
  characters and text characters under MS-DOS, so some @code{fseek}
! operations may not do exactly what you expect. 
  
  @subheading Return Value
  
--- 34,45 ----
  been opened as a text file.  Although this restriction is not enforced,
  beware that there is not a one-to-one correspondence between file
  characters and text characters under MS-DOS, so some @code{fseek}
! operations may not do exactly what you expect.
! 
! Also, since @code{lseek} under DOS does not return an error indication
! when you try to move the file pointer before the beginning of the file,
! neither will @code{fseek}.  Portable programs should call @code{ftell}
! after @code{fseek} to get the actual position of the file pointer.
  
  @subheading Return Value
*** src/libc/posix/unistd/lseek.t~0	Mon Jul 10 05:40:48 1995
--- src/libc/posix/unistd/lseek.txh	Sat Nov 22 19:26:34 1997
***************
*** 29,34 ****
--- 29,39 ----
  
  @end table
  
+ Note that DOS does not mind if you seek before the beginning of the
+ file, like seeking from the end of the file by more than the file's
+ size.  Therefore, @code{lseek} will not return with an error in such
+ cases either.
+ 
  @subheading Return Value
  
  The new offset is returned.
  

- Raw text -


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