×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    76

    Data read & write in a file

    Hi All
    I'm trying to read a text file and write the content of that text file into another text file.

    Code is as below

    String oldName= "file:///C:/data/text1.txt";
    String newName= "file:///C:/data/text2.txt";

    FileConnection fci = (FileConnection)Connector.open(oldName);
    FileConnection fco = (FileConnection)Connector.open(newName);

    Whenever i want to run it through neatbeans6.0 it shows that root isn't accessible.

    BR
    Javed
    Last edited by Aliencse; 2008-04-02 at 13:17.

  2. #2
    Nokia Developer Champion
    Join Date
    Sep 2007
    Posts
    915

    Re: Data read & write in a file

    There will be folder named named root1 in the follwing path.

    C:\WTK22\appdb\DefaultColorPhone\filesystem\

    put your file and directory in it.

    And crate string as followign.

    "file///root1/dir1/dir2/file1.txt"
    Last edited by honest_success; 2008-04-01 at 21:15. Reason: spelling mistake

  3. #3
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    76

    Re: Data read & write in a file

    Thanks for your reply. No i dont it for wtk only. I did it before through wtk2.5.

    But I want to read and write file through neatbean 6.0 editor which includes wtk 2.5.2. Now tell me through neatbean how i can read and write file? what will be exact path?

    Thanks in advance
    Javed

  4. #4
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    76

    Re: Data read & write in a file

    Hi Honest_Success

    If i want to read a file from a path , the path isn't like as C:\WTK\appdb\DefaultColorPhone\filesystem\root1 and then want to write the content of that file to a file as my expected path, is it possible?

    BR
    Javed

  5. #5
    Regular Contributor
    Join Date
    Dec 2007
    Posts
    62

    Re: Data read & write in a file

    Hi ,
    I dont understand what you are telling but see if you are using WTK2.5 means you are developing application which runs in a mobile and in mobiles you dont find a path like C:\.... . If you want to read from simple system or server use http or stream connection and connect to the system to read or write . But make sure that the system must have IP address with which you can connect.
    BR

  6. #6
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    76

    Re: Data read & write in a file

    Hi Susrap
    Yap I'm using wtk2.5, no right now I'm not testing it on mobile, now I'm testing read & write in pc's.

    Read & write file can be done in pc's root1 folder where wtk is installed like C:\WTK\appdb\DefaultColorPhone\filesystem\root1.

    But I'm trying to read & write a file as my expected folder or path not from root1 folder.

    Is it possible???

    BR
    Javed

  7. #7
    Regular Contributor
    Join Date
    Dec 2007
    Posts
    62

    Smile Re: Data read & write in a file

    Quote Originally Posted by Aliencse View Post
    Hi Susrap
    Yap I'm using wtk2.5, no right now I'm not testing it on mobile, now I'm testing read & write in pc's.

    Read & write file can be done in pc's root1 folder where wtk is installed like C:\WTK\appdb\DefaultColorPhone\filesystem\root1.

    But I'm trying to read & write a file as my expected folder or path not from root1 folder.

    Is it possible???

    BR
    Javed
    Sorry for delay.Try using socket connection by connecting to the system using IP.But i dont think it will work . If you want to access from server you can do it very easily using Http or Stream Connection Api's
    BR.

  8. #8
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    76

    Re: Data read & write in a file

    Hi Susrap
    I think you couldn't identify mine problem. No i don't wanna acces any remote devices so server or other remote devices...........needn't to mention here.

    I told you that file read and write work fine in the following directory

    C:\WTK\appdb\DefaultColorPhone\filesystem\root1.

    But I'm trying to read & write file as my expected directory or path not from C:\WTK\appdb\DefaultColorPhone\filesystem\root1.
    Is it possible???

    Regards
    Javed

  9. #9
    Regular Contributor
    Join Date
    Dec 2007
    Posts
    62

    Re: Data read & write in a file

    Quote Originally Posted by Aliencse View Post
    Hi Susrap
    I think you couldn't identify mine problem. No i don't wanna acces any remote devices so server or other remote devices...........needn't to mention here.

    I told you that file read and write work fine in the following directory

    C:\WTK\appdb\DefaultColorPhone\filesystem\root1.

    But I'm trying to read & write file as my expected directory or path not from C:\WTK\appdb\DefaultColorPhone\filesystem\root1.
    Is it possible???

    Regards
    Javed
    Try to understand the logic i am not talking about any remote system . I was explaining about methods to connect to system.If you can use blue tooth you can also use that . Without connecting how can you access the files in system ?? . If you have already tried the ways which i have told you then i think its not possible if u haven't tried just try it . OK.
    BR.

Similar Threads

  1. data file read and write
    By toinks in forum Symbian
    Replies: 28
    Last Post: 2006-11-07, 08:27
  2. Read and Write a custom settings file....
    By skhimsara in forum Symbian
    Replies: 2
    Last Post: 2006-04-25, 06:01
  3. Replies: 1
    Last Post: 2005-05-26, 14:22
  4. nokia 7210 modem via IR doesn't work !
    By oussamaaiadi in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2003-03-06, 10:46
  5. Replies: 0
    Last Post: 2002-06-10, 12:24

Posting Permissions

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