Re: FILEMAN.E

new topic     » goto parent     » topic index » view thread      » older message » newer message

>When you delete a record just overwrite a ~ (tilde) character
>over the first position in the deleted record.

   That was my initial thought as well, but once you overwrite a character
   in the record, you have no way to recover it.  It will be a big pain in
   the neck to re-write FILEMAN this way, but it preserves the entire
   record for recovery later on.  And if anyone is deleting lots of records
   from a file, it's probably going to get large enough that one extra byte
   in every record will hardly be noticeable.

>To compact the file all you have to do is find the first record in file
>that begins with ~ (tilde) and over write it with the next record if
>that record is deleted skip to the next record and etc. I hope you
>understand what I mean. This would be done in a buffer in memory and
>would be fairly fast. You could also use a filter that reads
>in a file and outputs a file while skiping the ~ (tilde) records.

    That's pretty close to what I had in mind.  I won't overwrite deleted
    records, but there will be a command line utility (REFORMAT.EX) to
    purge all the deleted records from a file.  Again, the advantage here
    is to be able to recover a deleted record (and it keeps the most
    recently written data in one spot at the end of the file). When the
    file gets too large, reformatting it will permanently erase all the
    deleted records and shrink the file size down.

>Hope you feel better soon

    Thanks :)

Brian Jackson

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu