delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/02/17/01:52:11

Delivered-To: listarch-cygwin AT sourceware DOT cygnus DOT com
Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
From: Christopher Faylor <cgf AT cygnus DOT com>
Message-ID: <19990216205243.L16511@cygnus.com>
Date: Tue, 16 Feb 1999 20:52:43 -0500
To: earnie_boyd AT yahoo DOT com, Peter Kabal <kabal AT ece DOT mcgill DOT ca>
Cc: cygwin users <cygwin AT sourceware DOT cygnus DOT com>
Subject: Re: Cygwin B20 - fseek under gcc fails to reposition on text files
References: <19990216154134 DOT 3413 DOT rocketmail AT send104 DOT yahoomail DOT com>
Mime-Version: 1.0
X-Mailer: Mutt 0.93i
In-Reply-To: <19990216154134.3413.rocketmail@send104.yahoomail.com>; from Earnie Boyd on Tue, Feb 16, 1999 at 07:41:34AM -0800

On Tue, Feb 16, 1999 at 07:41:34AM -0800, Earnie Boyd wrote:
>
>Ok I appoligize.
>
>Here is the "Microsoft VC++ Run-Time Library Reference" quote:
>
>For streams opened in text mode, fseek has limited use, because
>carriage return-linefeed translations can cause fseek to produce
>unexpected results.  The only fseek operations guaranteed to work on
>streams opened in text mode are:
>
>* Seeking with an offset of 0 relative to any of the origin values.
>
>* Seeking from the beginning of the file with an offset value returned
>from a call to ftell.
>
>Also in text mode, CTRL+Z is interpreted as an end-of-file character
>on input.  In files opened for reading/writing, fopen and all related
>routines check for a CTRL+Z at the end of the file and remove it if
>possible.  This is done because using fseek and ftell to move within
>an file that ends in CTRL+Z may cause fseek to behave improperly near
>the end of the file.
>
>---
>
>Based on the documentation then I'll have to agree that your programs
>isn't behaving as the documentation states that it should.  But, which
>is wrong, fseek or ftell?
>
>Sorry for speaking out of line,

This does sound like a bug.  We'll try to look into this, time permitting.

If anyone else wants to take a stab at this (Corinna?) I'd be very grateful.

-chris

- Raw text -


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