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 <pe...@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@delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
> unsubscribe
>
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

Reply via email to