×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    37

    Wink Reading filenames in directory??????

    hi,
    i have to read all file names present in directory and store it in one string array.
    Please suggest me how can i do it??
    or suggest me library or package like FILE in java.

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Reading filenames in directory??????

    You need a device that supports JSR 75 (File API), javax.microedition.io.file.

    The FileConnection interface specifies methods like isDirectory() and list().

    Cheers,
    Graham.

  3. #3
    Registered User
    Join Date
    Feb 2009
    Posts
    37

    Wink Re: Reading filenames in directory??????

    hi grahamhughes,
    can u provide me link or any example to use "filecon.dir.photos.name".

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Reading filenames in directory??????

    I have no link, but I'm sure if you take a look at the documentation and experiment a little, you'll get somewhere.

    Cheers,
    Graham.

  5. #5
    Super Contributor
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330

    Thumbs up Re: Reading filenames in directory??????

    Hi manish,
    please checkout the following link
    http://library.forum.nokia.com/
    see the list() function in javadocs of FC api jsr75.
    thanks,
    jitu_goldie..

    KEEP TRYING..

  6. #6
    Registered User
    Join Date
    Aug 2008
    Location
    Gurgaon, India
    Posts
    155

    Re: Reading filenames in directory??????

    use the following code:
    Code:
    import javax.microediton.io.file.*;
    import javax.microediton.io.*;
    import java.io.*;
    import java.util.*;
    ....
    ....
    String path="file:///"+exact path of the folder on mobile
    Vector FileList=new Vecor();
    try
    {	FileConnection fc=(FileConnection)Connector.open(path,Connector.READ);
    	Enumeration e=fc.list("*.*",false);
    	if(fc!=null)
    		fc.close();
    	while(e.hasMoreElements())
    		FileList.addElement(exact_path+"/"+e.nextElement().toString());
    }catch(IOException ioe){System.out.println(ioe.toString());}
    Vineet Billorey "The Great"

Similar Threads

  1. Error in packaging process :(
    By a-eqla3 in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2008-07-24, 20:33
  2. Strange problem with compilation!!! ARM9E
    By dmazgalin in forum Symbian
    Replies: 1
    Last Post: 2007-11-02, 09:33

Posting Permissions

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