I looked up the code that you have referenced in your link. Then I looked up the code for the implementation of the StructFile class referenced in it. Unfortunately, there is no easy way to do what you are asking. The StructFile class is simple sequential access of a binary file. It can write new structures to the end of the file, and read structures out of the file, starting at the beginning, in a sequential manner. There is no concept of random access in any of it.
Now to answer your question...
To delete the ith entry out of the file, you need to:
1. Create a temporary StructFile.
2. Read structures from the original file, writing each into the temporary file until you reach the ith one.
3. Do not write the ith structure, continue reading the rest of the structures and writing them to the temporary file until you reach EOF for the original file.
4. Delete the original file.
5. Rename the temporary file using the name of the original file.
Sequential file access is very simple to code, and very efficient at what it is designed for. What it does well is create a file and read/write sequentially from/to it. When you need to access a particular record (or object) in the file (for read/write/update/delete) is where things get exponentially more complicated.
Last edited by CGKevin; October 3rd, 2012 at 02:44 PM.