delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/11/20/23:27:35

From: fseibel AT cfa DOT harvard DOT edu (Fred Seibel)
Subject: Problem with fsetpos
20 Nov 1997 23:27:35 -0800 :
Message-ID: <01bcf5b7$190639f0$162085ce.cygnus.gnu-win32@0HNER.sprintmail.com>
Mime-Version: 1.0
To: <gnu-win32 AT cygnus DOT com>

I have a UNIX program that makes extensive use of fgetpos and fsetpos to
move around a file.

I have discovered that fsetpos with values of offset greater than ~ 2000L
misses the corrrect value.  The
error is 16 at 2000 and 179 at 10000.  I am running WindowsNT 4.0
Workstation, with Service Patch 3.
I am running b18.

This error can be detected by inspection using gdb.
Open a text file a trivial program.

main(){
fp = fopen("foo.txt", "r");
fsetpos(fp, 2000L, SEEK_SET);

<breakpoint>

gdb>print *fp
shows the next text that will be read.
Open file in emacs and position to char 2000.

Observe that the file seems to be positioned at 1984. hmmmm.

Fred Seibel
Software Develoment Manager
AXAF Science Center
Smithsonian Astrophysical Observatory
fseibel AT cfa DOT harvard DOT edu




-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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