Free Disk Necessary To Restructure A File

Richard Kreiss rkreiss at gccconsulting.net
Sun Jul 27 06:01:50 PDT 2008


Top post:

Remember to backup your file before you do the restructure.  Maybe back it
up twice and do a verify to insure the backup.  99.9% of the time the
restructure is not a problem.  But........




> Cc: filepro-list at lists.celestial.com
> Subject: RE: Free Disk Necessary To Retructure A File
> 
> Yes,
> In the case of *adding* characters to a file... you only need the entire
> disk space available (including the original file) to be the size of the
> "resulting" file.  so, if your file takes up 500MB and you have a 600MB
> disk.... you can only add 100MB more to that file, however you do the
math.
> If you take the very same 500MB file and try to "remove" characters from
> it... the program will break and your data will be lost... and everything
> bad will happen, because in this case you would need at least the size of
> the original file in free disk space *before*  you start the shuffle
> operation.
> 
> Actually, in such a situation, I think filePro's free disk free check
would
> complain and say the re=shuffle could not be done, rather than destroy
your
> data, but I wouldn't chance this. :-)  Do the calculating yourself
first...
> or you will end up having to break out of the define program, or carefully
> roll lback all of your changes. Yikes, it would just be a hassle.
> 
> John
> 
> P.s. Even though with the "in-place" re-define thing you don't need a
> duplicate size area of free space available as the size of your final file
> to do a shuffle that adds characters... I would hope that you would have a
> few extra bytes more than the final restructured size free for safety's
> sake.  I don't know who safety is, but he likes extra on everything.
> 
> John
> 
> 
> > -----Original Message-----
> > From: Scott Walker [mailto:ScottWalker at RAMSystemsCorp.com]
> > Sent: Saturday, July 26, 2008 6:38 PM
> > To: john at valar.com
> > Cc: 'filePro_List'
> > Subject: RE: Free Disk Necessary To Retructure A File
> >
> > 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
> 
> _______________________________________________
> 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