Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

truncating file

Status
Not open for further replies.

butthead

Programmer
Feb 24, 2002
545
US
scenario

I have a file that is 200 bytes. I want to chop the last 50 bytes without rewriting the whole file. can I do this or must I resign my self to the rewrite. I am creating a database engine and have found the hardest part of the whole thing so far is handling the delete in an efficient manner. if the table gets too large a rewrite of the table could be time consuming.

thanks for the help

tomcruz.net
 
Years ago I didn't know how to delete a record in a file, what I did was to create a temporal file and then copy what I want that the file storage



---LastCyborg---
 
I was thinking that I will have to create some rules as to when to rewrite the file. I must determine how much slack is acceptable and how to hide the empty records. I suppose when the slack reaches a certain amount the rewrite will follow. I must also track the empty records until the file is rewritten. I wonder if this is the "pack" process that I have seen in the BDE.

just more details to attend to...

tomcruz.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top