search files in directory

Discussion in 'Java' started by Guest, Sep 13, 2003.

  1. Guest

    Guest Guest

    I want something like DOS "dir" or Linux "ls" to retrieve the contents of one directory.

    Is this possible with Java's API?
     
    Guest, Sep 13, 2003
    #1
    1. Advertising

  2. On Sat, 13 Sep 2003 15:48:22 +0300, <- Chameleon -> wrote:
    > I want something like DOS "dir" or Linux "ls" to retrieve the
    > contents of one directory.
    >
    > Is this possible with Java's API?


    If you'd looked at the API documentation you'd have had no trouble
    finding this:

    http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html#listFiles()

    /gordon

    --
    [ do not email me copies of your followups ]
    g o r d o n + n e w s @ b a l d e r 1 3 . s e
     
    Gordon Beaton, Sep 13, 2003
    #2
    1. Advertising

  3. Guest

    Roedy Green Guest

    On Sat, 13 Sep 2003 15:48:22 +0300, "<- Chameleon ->"
    <> wrote or quoted :

    >I want something like DOS "dir" or Linux "ls" to retrieve the contents of one directory.
    >
    >Is this possible with Java's API?


    see http://mindprod.com/jgloss/file.html

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Sep 13, 2003
    #3
  4. Guest

    Roedy Green Guest

    On 13 Sep 2003 16:14:14 +0200, Gordon Beaton <> wrote or
    quoted :

    >If you'd looked at the API documentation you'd have had no trouble
    >finding this:


    That is not true. Java hides the directory manipulating functions in
    the File class, not exactly where any sane person would expect to find
    them.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Sep 13, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. TJS
    Replies:
    1
    Views:
    539
    Eliyahu Goldin
    Jun 23, 2004
  2. ejcosta
    Replies:
    2
    Views:
    898
    Eurico Costa
    Oct 8, 2004
  3. Abby Lee
    Replies:
    5
    Views:
    447
    Abby Lee
    Aug 2, 2004
  4. MP
    Replies:
    1
    Views:
    135
    Nathan Sokalski
    May 13, 2005
  5. Peter Hanke
    Replies:
    1
    Views:
    157
    Dr.Ruud
    Jan 6, 2008
Loading...

Share This Page