×

Discussion Board

Results 1 to 3 of 3

Thread: File not saving

  1. #1
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    272

    Unhappy File not saving

    Hello friends,

    I am writing an application, which saves the data(byte[]) on WTK filesystem.

    I am getting the data(byte[]) from SreamConnection.

    While writing this daya(byte[]) on file using:
    try
    {
    fc1 = (FileConnection)Connector.open("file:///root1/Img.bmp");
    if (!fc1.exists())
    {
    fc1.create();
    }
    if (fc1 != null)
    {
    if (fc1.exists())
    {
    out = fc1.openOutputStream();
    out.write(imgData);
    out.close();
    fc1.close();
    }
    }
    else
    {
    System.out.println("fc1 is null ");
    }

    fc1.close();
    }
    catch (Exception e)
    {
    e.printStackTrace();
    }


    I am not getting any exception. Idont know why it is not saving the data.

    Please suggest me.

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: File not saving

    Tested your code on WTK 2.5 and it does work. Can you check if you have a file named "in.use" under your <WTK_PATH>\appdb\<USED_EMULATOR>\ folder? Sometimes the emulator, when closing in a wrong way, leaves that lock that prevents following runs to access filesystem.

    Pit

  3. #3
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    272

    Re: File not saving

    hi jappit,

    Actually the file size is more than 2MB.

    It is coming from StreamConnection.

    It is executed well normally means opening a connection and writing into that file.

    But for my application the data is coming from streamConnection.

    And its not saving the data. even it is not creating out put file.

Similar Threads

  1. problem when importing from carbide c++ to vs 2003!
    By misfit.physics in forum Symbian Tools & SDKs
    Replies: 12
    Last Post: 2008-02-19, 09:45
  2. Error with makesis.exe and creating the .pkg file
    By gramya87 in forum Symbian Tools & SDKs
    Replies: 7
    Last Post: 2007-10-10, 13:53
  3. File server: Compilation error in carbide.c++
    By justteam in forum Symbian
    Replies: 6
    Last Post: 2007-01-03, 23:44
  4. Saving a txt file
    By Amilael in forum Symbian
    Replies: 3
    Last Post: 2006-09-07, 11:11
  5. Replies: 1
    Last Post: 2006-08-24, 15:37

Posting Permissions

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