Satya Prasad wrote:
> I am trying (C program in unix) to insert data into a text file while reading 
> the file in "r+" mode. The issue is that it overwrites the text file content 
> if data to be inserted is more than the length of data read. 
> 
> Is there is a possible way to insert data in a text file without overwriting 
> data in the file?
> 
> Regards,
> Prakash

There is no such thing as a "record" in C/C++.  A "text" file is just a 
special case of a binary file.  Although, I argue that there is no such 
thing as a text file either.  I treat all files as a stream of bytes or 
a chunk of raw data, which solves the problem.

-- 
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197

*NEW* MyTaskFocus 1.1
Get on task.  Stay on task.

http://www.CubicleSoft.com/MyTaskFocus/

Reply via email to