Open a RFileWriteStream for appending
| Sat, 2007-01-27 16:52 | |
|
Hi,
I want to open an existing file as a stream for appending. How can I solve this? RFileWriteStream.Open/Create/Replace seems to be only for overwriting. (Am I wrong?) SDK says: "The stream will be written to offset zero in the file." How can I change this? regards Martin |
|






Forum posts: 1246
René Brunner
Forum posts: 63
RFile fh;
fh.Open(iFs, *iLogFileName, EFileShareAny|EFileStream|EFileRead);
CleanupClosePushL(fh);
// 2) seek the EOF
TInt offset = 0;
fh.Seek(ESeekEnd, offset);
// 3) cleanup
CleanupStack::PopAndDestroy(&fh);
// move the position of the write mark in the stream by the specified offset
iFileWriteStream.Sink()->SeekL(MStreamBuf::EWrite, TStreamPos(offset));
regards
Martin