Re: problem with fseek
- From: Dann Corbit <dcorbit@xxxxxxxxx>
- Date: Wed, 8 Dec 2010 12:43:01 -0800
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.
.
- Follow-Ups:
- Re: problem with fseek
- From: robertwessel2@xxxxxxxxx
- Re: problem with fseek
- References:
- problem with fseek
- From: Zach
- Re: problem with fseek
- From: Zach
- Re: problem with fseek
- From: Ian Collins
- Re: problem with fseek
- From: Zach
- problem with fseek
- Prev by Date: Re: strcpy overlapping memory
- Next by Date: Re: strcpy overlapping memory
- Previous by thread: Re: problem with fseek
- Next by thread: Re: problem with fseek
- Index(es):