×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Regular Contributor
    Join Date
    Jun 2006
    Posts
    230

    Question File system fails on real device!!

    Hi all..

    Previously I had put the question regarding file system and by the help of forum I was able to achieve that on emulator. The thing was..I wanted to put flag in file and whenever application opens, it must check the status of that flag.

    Code snippet:
    _LIT(KFileName, "c:\\test.txt");
    _LIT8(KFlag, "0");

    RFs fs;
    fs.Connect();
    CleanupClosePushL(fs);

    RFile file;
    TInt err = file.Open(fs, KFileName, EFileShareAny | EFileWrite);
    if(err != KErrNone)
    {
    err = file.Create(fs, KFileName, EFileShareAny | EFileWrite);
    }
    if (!err)
    {
    CleanupClosePushL(file);

    TBuf8<100> FileContent;
    file.Read(FileContent);
    TBuf8<1> flag=FileContent.Right(1);
    _LIT8(myFlag1, "0");
    _LIT8(myFlag2, "1");
    _LIT8(myFlag3, "2");
    if (flag == myFlag1)
    {
    iDialog->notedisplay();
    _LIT8(KFlag, "1");
    User::LeaveIfError(file.Write(KFlag));


    }
    else
    if (flag == myFlag2)
    .
    .
    . and so on

    CleanupStack::PopAndDestroy(); // file
    }
    CleanupStack::PopAndDestroy(); // fs
    This code runs well with emulator and file is also created in C:\Symbian\7.0s\Series60_v21_CW\Epoc32\winscw\c but when I try it on real device, file is created but it doesn't check for flags and dont open anything :(

    Can anybody help???

    Regards

    Symbee

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: File system fails on real device!!

    Is there a branch in "and so on" which actually writes something when the file is empty?

  3. #3
    Regular Contributor
    Join Date
    Jun 2006
    Posts
    230

    Re: File system fails on real device!!

    When myflag2 is there it will ask for some activationcode in query dialog that is need to be checked and in myFlag3, if that activation code is correct than it will open my real application!! So there is no branch in the code

    And file never get empty. It has flag 0 or 1 or 2

  4. #4
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,336

    Smile Re: File system fails on real device!!

    Hello Symbee,

    Same question as what wizard_hu_ asked:
    Where are you writing in the file when it is empty?

    Your given code suggests that you are writing into the file when there is already something in it. So question is: are you writing somewhere else in your file?

    Or
    Are you supplying file(having data) in the .pkg entries?

    Regards.
    Kiran.

  5. #5
    Regular Contributor
    Join Date
    Jun 2006
    Posts
    230

    Re: File system fails on real device!!

    I initiate the file with 0 and than the whole procedure starts. Just now I am doing it manually

  6. #6
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,336

    Smile Re: File system fails on real device!!

    Hi,
    Quote Originally Posted by symbee
    I initiate the file with 0 and than the whole procedure starts. Just now I am doing it manually
    How do you do that? From Where?
    From FileExplorer?

    Regards.
    Kiran.

  7. #7
    Regular Contributor
    Join Date
    Jun 2006
    Posts
    230

    Re: File system fails on real device!!

    Yes, from FileExplorer

  8. #8
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,336

    Smile Re: File system fails on real device!!

    Hi,

    Ok. Better you supply test.txt from within .pkg file.

    "C:\Symbian\7.0s\Series60_v21_CW\Epoc32\winscw\c\test.txt" - "c:\test.txt"
    And make sure that test.txt contains some initial value from the following path in your PC:
    C:\Symbian\7.0s\Series60_v21_CW\Epoc32\winscw\c

    Regards.
    Kiran.

  9. #9
    Regular Contributor
    Join Date
    Jun 2006
    Posts
    230

    Re: File system fails on real device!!

    But whatever..It should check the flag status from file and than should show me the related UI!! but it doesn't show me anything???!!!

    Kindly help

  10. #10
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,336

    Smile Re: File system fails on real device!!

    Hi Symbee,

    I think it should work from FileExplorer too.
    But let's have a try atleast from .pkg entry.

    Or create that file programmatically within your code.

    Regards.
    Kiran.

  11. #11
    Regular Contributor
    Join Date
    Jun 2006
    Posts
    230

    Re: File system fails on real device!!

    Ok..Thanx Kiran!

    I would try it.bt for both emulator and mobile device..this path would work??

    Regards
    symbee

  12. #12
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,336

    Smile Re: File system fails on real device!!

    Hello Symbee,
    Quote Originally Posted by symbee
    Ok..Thanx Kiran!

    I would try it.bt for both emulator and mobile device..this path would work??

    Regards
    symbee
    Yes, it would work.
    Try out the suggestions provided in previous post. :)
    I hope it will help you.

    Regards.
    Kiran.

  13. #13
    Regular Contributor
    Join Date
    Jun 2006
    Posts
    230

    Re: File system fails on real device!!

    Hi Kiran,

    I did what u suggested. Now let me tell u my preblem with real device..

    1) In my pc I set flag value in file to 0.when I install application, and check the file status..it's 012(which i intially don't want)

    2) So whatever i want by checking of flag 0 and 1, it doesn't appear! bt it checks value 2 and opens my actual application instead of query dialog and note.

    3) my flow is

    flag=0-> opens note
    flag=1-> opens edwin query(validates)
    flag=2-> opens real application form

    4)when I agin set value by 0 in device file manager, it doesn't open anything(not even previously shown form!)

    Kindly help
    Regards
    Symbee

  14. #14
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,336

    Re: File system fails on real device!!

    Hi,
    Quote Originally Posted by symbee
    Hi Kiran,
    1) In my pc I set flag value in file to 0.when I install application, and check the file status..it's 012(which i intially don't want)
    ......
    1)Are you supplying file from .pkg entries?
    Or
    2)Are you creating file programmatically in your code?

    If 1) is the case then after fresh installaion check for the value of test.txt using FileExplorer.
    What's initial value of test.txt before entering into Your application?

    Regards.
    Kiran.

  15. #15
    Regular Contributor
    Join Date
    Jun 2006
    Posts
    230

    Re: File system fails on real device!!

    Hi Kiran,
    I have created file programmatically,

    _LIT(KFileName, "c:\\test.txt");
    RFs fs;
    fs.Connect();
    CleanupClosePushL(fs);

    RFile file;
    TInt err = file.Open(fs, KFileName, EFileShareAny | EFileWrite);
    if(err != KErrNone)
    {
    err = file.Create(fs, KFileName, EFileShareAny | EFileWrite);
    }
    and as u said I put the path in .pkg file

Similar Threads

  1. SDP File on Nokia 6630 Real Player
    By manupeco in forum Streaming and Video
    Replies: 4
    Last Post: 2008-02-18, 11:59
  2. Symbian file system
    By gargidasgupta in forum Symbian
    Replies: 0
    Last Post: 2004-09-20, 08:55
  3. Symbian File System
    By gargidasgupta in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2004-09-20, 08:52
  4. How to delete file when i unistall my sis from device
    By alokkumarsingh in forum Symbian
    Replies: 8
    Last Post: 2004-06-22, 16:46
  5. Replies: 1
    Last Post: 2002-05-16, 19:08

Posting Permissions

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