Date: Sun, 25 Jul 1999 11:33:04 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Pavlos cc: djgpp AT delorie DOT com Subject: Re: ftruncate In-Reply-To: <7nber9$3j4$1@newssrv.otenet.gr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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.