<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4943.400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Yep, there's a truncate procedure in Delphi. One of
the old Pascal file-handling procedures. It doesn't look at though setting the
size of a Filestream is going to do anything.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Regards,</FONT></DIV>
<DIV><FONT face=Arial size=2>Brian</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=ross@stationplaylist.com href="mailto:ross@stationplaylist.com">Ross
Levis</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=delphi@ns3.123.co.nz
href="mailto:delphi@ns3.123.co.nz">NZ Borland Developers Group - Delphi
List</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, October 13, 2004 9:52
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [DUG] truncate a disk file</DIV>
<DIV><BR></DIV>
<DIV><FONT face=Arial size=2>I'm fairly sure it's not possible but I thought I
would ask to be sure. Is there any way to truncate a file on disk
without re-writing it to a new file and deleting the old one? Say I have
a 40 meg file and I want to remove the last 128 bytes from the file. If
it's not possible, it seems rediculous that Microsoft did not provide a way to
do it. Logically, it should be possible by splitting the
directory entry into 2, and deleting the 2nd entry. Or maybe some
manipulation of the file allocation table.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><FONT color=#000000>Cheers,</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT
color=#000000>Ross.</FONT></FONT></DIV></BLOCKQUOTE></BODY></HTML>