Reading from a directory

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thatos
    New Member
    • Aug 2007
    • 105

    Reading from a directory

    I know how to read maybe values in files, but is there a way to for example get names of files in a directory and manipulate somehow this files?
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by thatos
    I know how to read maybe values in files, but is there a way to for example get names of files in a directory and manipulate somehow this files?
    Did you read the API documentation for the File class? Your answer can
    be found there.

    kind regards,

    Jos

    Comment

    • BigDaddyLH
      Recognized Expert Top Contributor
      • Dec 2007
      • 1216

      #3
      From Sun's tutorial: http://java.sun.com/docs/books/tutor...l/io/file.html

      Comment

      • samido
        New Member
        • Oct 2007
        • 52

        #4
        Hi, did you guys sometimes use those powerful java IDE's, they are open sources and they are very helpful with usage of java API's, currently eclipse is the best, for example if you declare something like:

        Flile f = new File("path and file name ");

        and if you type 'f.' and wait for a second, it will list all the operations that you can do or get from file object. hope this will help a lot that API's than asking API related question, he are hoping to get more program structures(OOP) related like inheritance, polymophism and encapsulation questions, remember PIE ....

        Sam Rabophala

        Comment

        • JosAH
          Recognized Expert MVP
          • Mar 2007
          • 11453

          #5
          Originally posted by samido
          Hi, did you guys sometimes use those powerful java IDE's, they are open sources and they are very helpful with usage of java API's, currently eclipse is the best, for example if you declare something like:

          Flile f = new File("path and file name ");

          and if you type 'f.' and wait for a second, it will list all the operations that you can do or get from file object. hope this will help a lot that API's than asking API related question, he are hoping to get more program structures(OOP) related like inheritance, polymophism and encapsulation questions, remember PIE ....

          Sam Rabophala
          The OP didn't even know that s/he should use the File class; what is an IDE to do
          then? If beginners followed up your advice this forum would be swamped with
          question from people like "how do I so and so with my IDE?" All those IDEs
          do is hide those basic mechanics for you but you still have to understand those
          basics in order to work properly with an IDE.

          The keyword here is "reading". People just don't read anymore before they start
          typing and simply hope for the best which basically means they curse Java
          because it doesn't work like visual basic does it. Posession of computers at
          home should be made a grave felony.

          kind regards,

          Jos

          Comment

          • thatos
            New Member
            • Aug 2007
            • 105

            #6
            Thanks for your help, it really helped a lot, now I know what to do.

            Comment

            • samido
              New Member
              • Oct 2007
              • 52

              #7
              ...you are still correct bt nothing aimed for the people to struggle a lot before they get how simple and efficient for the Java code to be implemented. we must still guide peple how to get this things easy and usable without going extra miles, when I start with developing carrier I used to ask my self how could people implement morethan 20 000 line of code per day... and you knows the answer...! Sam Rabophala

              Comment

              • BigDaddyLH
                Recognized Expert Top Contributor
                • Dec 2007
                • 1216

                #8
                Originally posted by samido
                ...you are still correct bt nothing aimed for the people to struggle a lot before they get how simple and efficient for the Java code to be implemented. we must still guide peple how to get this things easy and usable without going extra miles, when I start with developing carrier I used to ask my self how could people implement morethan 20 000 line of code per day... and you knows the answer...! Sam Rabophala
                How I learned to program: C and Emacs, with Dennis Ritchie's book "The C Programming Language" by my elbow.

                Comment

                • JosAH
                  Recognized Expert MVP
                  • Mar 2007
                  • 11453

                  #9
                  Originally posted by BigDaddyLH
                  How I learned to program: C and Emacs, with Dennis Ritchie's book "The C Programming Language" by my elbow.
                  I use VI(M) so we're enemies for life; btw LOCs of code, as the previous replier
                  mentioned, is a very bad metric; I feel happy after a day of negative LOCs ...

                  kind regards,

                  Jos

                  Comment

                  Working...