🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #1246

Re: Truncate a file from the beginning to the current position

#1246
From: Alan Bellingham
Date: Wed, 17 Oct 2007 15:10
21 lines
1719 bytes
"Mehmet Caner" <mcaner40@hotmail.com> wrote:

>> SetFilePointer + SetEndOfFile
>
>Thanks for your quick answer. But is it possible to truncate a file from the 
>beginning ? 

You mean, can you say "the new content of the file is from here to the
end"?

Sorry, but no.

You'll have to create a new empty file, and copy to it the data you want
kept. The ability to change where a file ends is easy for filing systems
(and fairly vital too, when you're appending data to it in the first
place), but not for where it starts.

Alan Bellingham
-- 
Team Browns
ACCU Conference 2008: 2-5 April 2008 - Oxford (probably), UK
Technical Details
Message-ID: <m89ch3h2tophqsg72tk7on1p092qsb9u3l@4ax.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4715d331@newsgroups.borland.com> <4715df73@newsgroups.borland.com> <47161c7b@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,92368457f5454c39
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Alan Bellingham <alan@lspace.org>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Truncate a file from the beginning to the current position
Date: Wed, 17 Oct 2007 16:10:41 +0100
Organization: Private
Reply-To: alan@lspace.org
Message-ID: <m89ch3h2tophqsg72tk7on1p092qsb9u3l@4ax.com>
References: <4715d331@newsgroups.borland.com> <4715df73@newsgroups.borland.com> <47161c7b@newsgroups.borland.com>
X-Newsreader: Forte Agent 4.2/32.1118
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 193.129.251.253
X-Trace: newsgroups.borland.com 1192633841 193.129.251.253 (17 Oct 2007 08:10:41 -0700)
Lines: 21
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail