×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    10

    [moved] Cant open the file on the device

    Hi,

    I have an application that works fine in the emulator. Im openning and acessing a file and works very well. When i try to run this application on the N82 i get an error.

    To run in the N82, im compiling as GCCE.

    I think the error is when i try to open the file, i have tried the following directories:
    "c:\\test.txt"
    "file:///c:/test.txt"
    "file:///c:\\test.txt"
    "c:\\Data\\test.txt"
    "file:///Memory Card/test.txt"
    "c:\\Data\\Others\\test.txt"
    and a lot of others paths.
    In all the paths i tried, i did make sure the file was there

    The error i get is "System Error"

    Anyone have any tips or know how can i solve this problem?

    thanks
    Last edited by cobrahc; 2008-07-16 at 14:52.

  2. #2
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Cant open the file on the device

    Can you show us how you tried to open your file. {Code}

  3. #3
    Registered User
    Join Date
    Jul 2008
    Posts
    10

    Re: Cant open the file on the device

    works fine in the emulator

    Code:
    RFs 	aFs;
    RFile 	theFile;
    TBuf8<50> buf8((unsigned char*)filename);
    TBuf16<50> buf16;
    buf16.Copy(buf8);	
    aFs.Connect();			
    TInt retorno = theFile.Open(aFs,buf16,EFileRead | EFileWrite);

    I had also included the
    "C:\NokiaS60\VisMobile\inc\ErrRd" - "c:\system\bootdata\ErrRd"
    in the pkg, but doesnt show the error code

    ErrRd is an empty file

  4. #4
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Cant open the file on the device

    TBuf8<50> buf8((unsigned char*)filename); can i ask why ???

    refer to http://wiki.forum.nokia.com/index.ph..._writing_files

  5. #5
    Registered User
    Join Date
    Jul 2008
    Posts
    10

    Re: Cant open the file on the device

    the filename im passing as a char[]....

    char * filename
    [t][e][s][t][.][t][x][t][\0]

    Since its my first time coding to nokia s60, im using in my code char* and not TDesC.. etc.

  6. #6
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Cant open the file on the device

    Quote Originally Posted by cobrahc View Post
    the filename im passing as a char[]....

    char * filename
    [t][e][s][t][.][t][x][t][\0]

    Since its my first time coding to nokia s60, im using in my code char* and not TDesC.. etc.
    i suggest you start your S60 learning from Forum Nokia getting started.

  7. #7
    Registered User
    Join Date
    Jul 2008
    Posts
    10

    Unhappy Re: Cant open the file on the device

    right now i dont have the time to do that... i have to run my application on the device ASAP. I was able to make it run on the emulator but it appears to be hard to run in the device.


  8. #8
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Cant open the file on the device

    run a application on device is different then running on device. Too bad that you do not have much time to learn symbian.C++ properly.

    So at least you have make sure you use proper data types when using Symbian APIs

  9. #9
    Registered User
    Join Date
    Jul 2008
    Posts
    10

    Re: Cant open the file on the device

    Quote Originally Posted by skumar_rao View Post
    run a application on device is different then running on device. Too bad that you do not have much time to learn symbian.C++ properly.

    So at least you have make sure you use proper data types when using Symbian APIs
    Im going try change the data types to the types accepted by the API.

    Any suggestion to see the error code of the application?
    I included the
    "C:\NokiaS60\VisMobile\inc\ErrRd" - "c:\system\bootdata\ErrRd"
    in the .pkg but still, doesnt appear the error code.
    ErrRd its an empty file

  10. #10
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Cant open the file on the device

    http://wiki.forum.nokia.com/index.ph...or_messages%3F
    If you look closely it is
    "ErrRd.pkg"-"c:\resource\errrd" not what you are using.

  11. #11
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,568

    Re: Cant open the file on the device

    If your code runs in the emulator, you should rather think about if test.txt is also present in the device or not. Do you create/deploy it somehow? Otherwise it is obviously not going to be there, and RFile::Open will return -1 (KErrNotFound).

  12. #12
    Registered User
    Join Date
    Jul 2008
    Posts
    10

    Re: Cant open the file on the device

    Quote Originally Posted by wizard_hu_ View Post
    If your code runs in the emulator, you should rather think about if test.txt is also present in the device or not. Do you create/deploy it somehow? Otherwise it is obviously not going to be there, and RFile::Open will return -1 (KErrNotFound).
    I think the application isnt finding the file but, im still trying to debug on the device (im getting error to connect the trk).

    I changed the location of the file in the device and checked if it was there but nothing worked.

    To access the //Phone Memory//Data//, i have to put "file:///c:/".. is that right?

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

    Re: Cant open the file on the device

    Quote Originally Posted by cobrahc View Post
    I think the application isnt finding the file but, im still trying to debug on the device (im getting error to connect the trk).

    I changed the location of the file in the device and checked if it was there but nothing worked.

    To access the //Phone Memory//Data//, i have to put "file:///c:/".. is that right?
    You need to put: C:\\Data\\YourFile...

    Do you really have file on the device on proper place you are querying about?

    For instance you may try Replace() instead of Open(). But this is just for testing purpose.

    Kiran.
    Nokia Developer Wiki Moderation team

  14. #14
    Registered User
    Join Date
    Jul 2008
    Posts
    10

    Re: Cant open the file on the device

    ErrRd just doesnt wanna work in the N82.
    im using
    "C:\NokiaS60\VisMobile\inc\ErrRd.pkg" - "c:\resource\ErrRd"
    SDK 3rd Edition FP1, N82
    ErrRd.pkg is an empty file

    Since doesnt work, i installed the YTasks::Crash Monitor.
    The info about the crash is:

    Exit category: Kill
    Exit type: Kill
    Exit reason: 0

  15. #15
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,568

    Re: Cant open the file on the device

    It is not Java, it is C++ (so forget URL-s when handling files).
    If you use the built-in File Manager, it shows c:\Data as phone-memory root, so probably "C:\\Data\\Other\\test.txt" is the path of your file.

Similar Threads

  1. File is not getting saved in device.
    By HidayathKhan in forum Mobile Java General
    Replies: 3
    Last Post: 2008-03-18, 06:53
  2. Problem opening file from a dynamic path
    By didienGanteng in forum Symbian
    Replies: 12
    Last Post: 2007-06-27, 11:13
  3. Contacts fields order??
    By timatima in forum Symbian
    Replies: 1
    Last Post: 2007-06-08, 13:51

Posting Permissions

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