[DUG] Setting Data File Size

Paul A Norman paul.a.norman at gmail.com
Sat Sep 5 17:08:26 NZST 2009


Not sure if I am on the same page as you John, are you still working this
through only just saw it?

One OS safe method - if you are using fixed record sizes, then instead of
removing a record (and repacking the file in situ) re-enter/alter the
record  with a key field saying "deleted" or something.

Then periodically when there is no file access going on run a maintanence
routine to rewrite the file to a copy not writing the deleted records
accross, then delete/backup original and rename your newly written
maintenece file as the original.

Paul


2009/8/26 Peter Hyde <peter at webcentre.co.nz>

> John asked:
>
> > Is there a simple way to alter the size of an existing file -
> > particularly to decrease the size?
>
> Unless TFileStream has changed since I last looked in detail, you
> won't find it easy.
>
> I know that in similar cases I ended up adopting the "write to temp
> file/rename-after" approach; I don't know if that would suit your
> conditions adequately.
>
>
> cheers,
> peter
>
> ===========================================
> Peter Hyde, Development Director
> * http://TurboNote.com <http://turbonote.com/> -- top-rated onscreen
> sticky notes
> * Web development and automation: http://webcentre.co.nz
>
>
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
> unsubscribe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20090905/d4a387b2/attachment.html 


More information about the Delphi mailing list