overwrite a text in a file using c++
===

I have a problem with the following code :

         fstream s("tst.txt" , fstream::binary);
         s.seekp(5, fstream::beg);
         s.write("testing", 7);

it should keep the first five character in the file as it is,but it doesn't !
it discard the whole old data,i have to keep the old data and overwrite just a block of file data , and it should be in a binary mode 
any one help?
thanks in advance.