Hi,
I'm developing on S60 3rd FP1 using Carbide.C++ IDE.
my problem is when is create a file using RFileWriteStream object as follows:
writeStream.Create(fileSession , static_cast<CMyApp*>(iAvkonAppUi)->iFullPath, EFileWrite);
And then in somewhere (when the user close the current view "Back Button") i tried to delete this file as follows:
EikFileUtils file;
file.DeleteFile(static_cast<CMyApp*>(iAvkonAppUi)->iFullPath, 0);
now i check if it does this work successfuly or not, and i found it did. but when i tried to repeat my scenario again (creating the file then press back soft key delete the file) it fired this error " STORE-Stream 0 " when it reached the creation line.
why is that?
------------------------------------------------------------------
EDIT:
for more details in how i create the file and stream.
TBuf<50> reqWord = static_cast<CMyApp*>(iAvkonAppUi)->iSearchWord;
RFile file;
RFileReadStream readStream;
RFileWriteStream writeStream;
TFileName fileName;
TParse tParser;
tParser.Set(htmlUrl,NULL,NULL);
fileName.Append(tParser.Name());
fileName.Append(_L("_temp.htm")); // where my temo file would be 001_temp.htm
RFs fileSession;
fileSession.Connect();
static_cast<CMyApp*>(iAvkonAppUi)->iFullPath.Append(tParser.DriveAndPath());
static_cast<CMyApp*>(iAvkonAppUi)->iFullPath.Append(fileName);
writeStream.Create(fileSession , static_cast<CMyApp*>(iAvkonAppUi)->iFullPath, EFileWrite);
// Open the Html file
TInt err = file.Open( CEikonEnv::Static()->FsSession(), htmlUrl, EFileRead );
if( err == KErrNone )
{
readStream.Attach( file );
while(true)
{
TRAP(err,readStream.ReadL(word, TChar(' ')));
if(err == KErrEof)
break;
//========================
My Algorithm
//========================
WriteInFile(word, writeStream);// write in the created file "001_temp.htm"
}
}
readStream.Close();
writeStream.Close();
file.Close();
fileSession.Close();
return static_cast<CMyApp*>(iAvkonAppUi)->iFullPath; // the end of my function where i return my temp file path coz in somewhere "in the HandelCommandL function in MYAppView.cpp " i need this path coz when the user clicks on "Back Button" and turn back to the prev. view i want to delete this temp file and i did that as follows:
EikFileUtils file;
file.DeleteFile(static_cast<CMyApp*>(iAvkonAppUi)->iFullPath, 0);
NOW:my problem is i can this function only once where if i called it again it crachs when reachs to the line of creation "writeStream.Create(fileSession , static_cast<CMyApp*>(iAvkonAppUi)->iFullPath, EFileWrite);"
and gives me this error and sometimes it may close the application with error KERN-EXEC 3
i hope i explained my problem clearly.
thnx in advance,
B.A

Reply With Quote

