vishnu said:
hello to all,
Can any one please tell me how to delete a record in a binary file.
There is no one single way to do this. Some possibilities
(some are suitable only for restricted notions of "a record"):
- Overwrite the record's bytes with a pattern that the
rest of the software package will ignore. For example,
the rest of the software might recognize an all-zero
telephone number as meaning "no data in this record."
- Overwrite the record's bytes with a copy of the very
last record in the file, and rewrite the file's header
(or similar self-description) to indicate that the file
is one record shorter than it used to be.
- Copy the entire file to a new file, but omit the record
in question when you come to it. Then delete the old
file and rename the new file.
.... and there are many other variations.