Welcome, Guest. Please login or register.

Author Topic: Adding to a growing file in the filesystem with C...  (Read 2469 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline CrazyProg

  • Newbie
  • *
  • Join Date: Oct 2004
  • Posts: 14
    • Show all replies
Re: Adding to a growing file in the filesystem with C...
« on: April 12, 2005, 09:40:06 PM »
The fragmentation of the file is unavoidable (as far as I know). :-(  
You could minimise it by creating bigger blocks for the file, keep writing data to the file untill the block is full then creating another big (empty) block for the file and filling it etc. :-)
Another thing that you could do is do a sort of log rotate thing.  When creating the file create it with a date imbeded in the name (YYYY-MM-DD is best that way 'dir' will put them in order) write you data to the file close it and don't use it again. :-)