Re: problem with fseek



In article <16a00f6e-a09a-486d-b846-
497eb8b5254a@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, netrek@xxxxxxxxx says...

On Dec 8, 5:27 am, Ian Collins <ian-n...@xxxxxxxxxxx> wrote:

That is exactly what you are telling it to do.  There isn't an insert
mode for writing files, data is either appended (as in your first
example) or over written.  If you wish to insert data, you have to read
the file, modify the data and then write it back.

Ah ok. Too bad C's standard library doesn't have insert functionality.

Store the log as a database file and then you can insert, update and
delete with impunity.

Some NOSQL database systems operate at near operating system file speed.
You might enjoy reading this:
http://fallabs.com/kyotocabinet/

A simpler solution might be to create a file that contains:
<HTML>
called start.tag and a second file that contains:
</HTML> called end.tag and then concatenate the three files to a target
file. Of course, this is slower and wastes space, but at least it is
simple.
.