adding data at the end of already exisiting file
-
HI, A file "ABC.txt" has already been created using CFile and modes CFile::modeCreate | CFile::modeWrite | CFile::typeBinary Now I am opeing it using modes CFile::modeNoTruncate | CFile::modeWrite | CFile::typeBinary and write the data in it but it do not appeand the data at its end. I am also using CFile::SeekToEnd(); Whats the write ways to add data at the end of already existing file? thanks Regards.
-
HI, A file "ABC.txt" has already been created using CFile and modes CFile::modeCreate | CFile::modeWrite | CFile::typeBinary Now I am opeing it using modes CFile::modeNoTruncate | CFile::modeWrite | CFile::typeBinary and write the data in it but it do not appeand the data at its end. I am also using CFile::SeekToEnd(); Whats the write ways to add data at the end of already existing file? thanks Regards.
I had a file with some text in it. And this code successfully appends text to it.
CStdioFile file; file.Open ("C:\\abc.txt",CFile::modeCreate | CFile::modeNoTruncate | CFile::modeWrite ); file.SeekToEnd (); file.WriteString ("Anshuman"); file.Close ();
Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_
-
I had a file with some text in it. And this code successfully appends text to it.
CStdioFile file; file.Open ("C:\\abc.txt",CFile::modeCreate | CFile::modeNoTruncate | CFile::modeWrite ); file.SeekToEnd (); file.WriteString ("Anshuman"); file.Close ();
Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_
-
You can achieve the same with your method.(using CFile) Post some code about how you are going with that and then we can comment on the change or modification you need to make. My Guess is that you may not be closing the file after creating it. Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_
-
HI, A file "ABC.txt" has already been created using CFile and modes CFile::modeCreate | CFile::modeWrite | CFile::typeBinary Now I am opeing it using modes CFile::modeNoTruncate | CFile::modeWrite | CFile::typeBinary and write the data in it but it do not appeand the data at its end. I am also using CFile::SeekToEnd(); Whats the write ways to add data at the end of already existing file? thanks Regards.
and this code is work or not work
CFile file(_T("c:\\test.txt"),CFile::modeNoTruncate | CFile::modeWrite ); file.SeekToEnd(); file.Write(_T("test"),4); file.Close ();
_**
**_
whitesky