delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/25/06:38:56

Date: Sun, 25 Jul 1999 11:33:04 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Pavlos <trash24379 AT usa DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: ftruncate
In-Reply-To: <7nber9$3j4$1@newssrv.otenet.gr>
Message-ID: <Pine.SUN.3.91.990725113244.27488U@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sat, 24 Jul 1999, Pavlos wrote:

> It seems that ftruncate will work only if the file pointer is before the
> position that I'm going to truncate from.

Please post the source of a short test program that exhibits this
behavior, and the data (file sizes shown by some utility) to
demonstrate the problem.  I think `ftruncate' should work in this case
also.

FYI, `ftruncate' moves the file pointer before truncating the file, so
its initial position should be irrelevant.

> I do close the file after ftruncate.

This is not necessary, actually, contrary to what the docs says.

- Raw text -


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