[DUG] Setting Data File Size

John Bird johnkbird at paradise.net.nz
Mon Sep 7 12:00:53 NZST 2009


That is what I ended up doing, works ok enough.   Such records get cleaned up in time.

John Bird
JBCL
Contact:
johnkbird at paradise.net.nz
03-3844527,  027 4844528
http://jbclnz.googlepages.com
http://www.jbcl.co.nz
  ----- Original Message ----- 
  From: Paul A Norman 
  To: NZ Borland Developers Group - Delphi List 
  Sent: Saturday, September 05, 2009 5:08 PM
  Subject: Re: [DUG] Setting Data File Size


  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 -- 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





------------------------------------------------------------------------------


  _______________________________________________
  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/20090907/2bc4ac65/attachment.html 


More information about the Delphi mailing list