Hi,
I am trying to read data from a file into an HBufC8 variable and then write the same data into another file. Here is my testcode; the inner loop of the read repeats 4 times to read 5000 chars in each iteration. However, when I try to write the data back into a file, the file "testfile.txt" is empty. Will play a little bit more around with it but help would be appreciated as always ;) Thanks
HBufC8* iFileBuffer = HBufC8::NewL(20000);
TPtr8 ptr(iFileBuffer->Des());
fp.Seek(ESeekStart,pos);
Err = fp.Read(ptr);
while(!Err && ptr.Length()>0)
{
Err = fp.Read(ptr);
Printf(_L("Data read: %d \n\n"), ptr.Length());
}
fp.Create(iFileServer,_L("C:\\testfile.txt"), EFileWrite);
fp.Seek(ESeekEnd,pos);
fp.Write(*iFileBuffer);
fp.Close();
delete(iFileBuffer);