×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    11

    File Program not working-Urgent

    Dear friends,

    This is my FILE Code. But neither the file is created nor the text is entered into it.

    What is the problem in this code.

    RFs iSession;
    RFile actualFile;
    _LIT(KFileName,"\\system\\apps\\cipher\\cipher.enc");
    1)TBuf8<6> readBuf1;
    TInt err;
    iSession.Connect();
    err=actualFile.Create(iSession,KFileName,EFileShareExclusive|EFileWrite|EFileRead);
    _LIT8(KWriteBuf,"write data");
    actualFile.Write(KWriteBuf);
    actualFile.Flush();
    actualFile.Read(0,readBuf1);
    2)iAppContainer->Passed (readBuf1);
    actualFile.Close();
    iSession.Close();
    break;

    The passed() is like this & in container.cpp

    void CUI3Container::Passed (const TDesC& aText)
    {
    des.Append(aText);
    DrawNow();
    }


    I included the f32file.h & the efsrv.lib file

    My questions are:

    1) Why the file is not created??
    2)The RFile::write() takes the parameter TDesC8 & read() takes the parameter TDes8.How to change the Passed function to print the read string r how to print the string using CAknInformationNote

    Please help me.

    Urs
    Ram.

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165
    Q1) what is the err error value generated ? it propably tells you what the problem is already. Anyway I would use absolute paths, that would include the drive letter as well, just to be safe.

    Q2) you could copy the value to the TBuf buffer and get it shown with the note.

    yucca

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×