Free Disk Necessary To Retructure A File

Scott Walker ScottWalker at RAMSystemsCorp.com
Sat Jul 26 15:38:05 PDT 2008


John,

So are you saying that if I had 10 million bytes free on my disk drive,
I could add a field to a file with 400mb as long as the resulting file
was not more than 10mb larger.

In other words, I don't need free disk space to be anywhere near the
size of the file I am restructuring.

Regards,

Scott


Scott Walker
RAM Systems Corp.
ScottWalker at RAMSystemsCorp.com
Ph: (704) 896-6549




-----Original Message-----
From: John Esak [mailto:john at valar.com] 
Sent: Saturday, July 26, 2008 6:32 PM
To: 'Scott Walker'
Cc: filepro-list at lists.celestial.com
Subject: RE: Free Disk Necessary To Retructure A File


<top posted question about file size in re-define>

You are right, You have plenty to spare.

I hate working in MB's... much better to work with the actual byte size
of the files and not worrry about converting to millions and then
dividing by 1024*1024, etc.  If you simply  add 20 to the 2837 (which
you are heading for, (because the Define files program does not display
the extar 20 byte header needed for each record), giving you 2857 and
multiply this times 159,000 + 1 (for the extra 0th record which is also
commonly forgotten... you end up with 454265857 bytes of space needed to
hold the new file... and that is really all you need.

Ken wrote the Define Files routine that adds characters, to do it "in
place". In other words you just move the end of file marker to the
highest point the file will require after the new full size is
calculated, and then writing all the records one by one from the end of
the file to their new position starting backwards from the end of the
file.  A nice, efficient way to make a file bigger back in the days when
disk space was at a huge premium.  

So, you really have plenty of room for your addition.  

If you were to *shrink* the file on the other hand (take away characters
from any field), this trick is not employed so you would need the full
new size of the file in free space, at least, for the "temp" file which
would be created and then moved into place.

John



> -----Original Message-----
> From: filepro-list-bounces+john=valar.com at lists.celestial.com
> [mailto:filepro-list-bounces+john=valar.com at lists.celestial.com] On 
> Behalf Of Scott Walker
> Sent: Saturday, July 26, 2008 3:25 PM
> To: 'filePro_List'
> Subject: Free Disk Necessary To Retructure A File
> 
> I just want to make sure...
> 
> I have a key file that is 436mb.
> 
> I am going to restructure it, changing the record length from 2735 to 
> 2837
> 
> I have 159,000 records in this file.
> 
> I have 515mb of free disk space.
> 
> I think I have enough disk space to do this.
> 
> Am I right?
> 
> Regards,
> 
> 
> Scott
> 
> 
> Scott Walker
> RAM Systems Corp.
> ScottWalker at RAMSystemsCorp.com
> Ph: (704) 896-6549
> 
> 
> 
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com 
> http://mailman.celestial.com/mailman/listinfo/filepro-list




More information about the Filepro-list mailing list