Discussion Board

Results 1 to 3 of 3

Thread: File not saving

  1. #1
    Regular Contributor manojkumar.m's Avatar
    Join Date
    Jan 2008
    Posts
    272
    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 jappit's Avatar
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,391
    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 manojkumar.m's Avatar
    Join Date
    Jan 2008
    Posts
    272
    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 C++
    Replies: 6
    Last Post: 2007-01-03, 23:44
  4. Saving a txt file
    By Amilael in forum Symbian C++
    Replies: 3
    Last Post: 2006-09-07, 11:11
  5. S60 3rd edition Http downloaded file saving problem
    By netlogins in forum Symbian C++
    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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved