View Single Post
Join Date: Nov 2008
Posts: 37
Reputation: caps_lock is an unknown quantity at this point 
Solved Threads: 0
caps_lock caps_lock is offline Offline
Light Poster

Re: Recursive File List - Help me problem solve please

 
0
  #10
Jan 11th, 2009
lol i started that thread but ignore that one for now lol

anyways

thanks masijade for your reply

i tried something new

modified code below

  1. public static void search(File f) {
  2. if ( !f.exists() ) return;
  3. String name = f.getName();
  4. System.out.println(name);
  5. if ( f.isDirectory() ) {
  6. File[] files = f.listFiles();
  7. if (files != null) {
  8. for( int i = 0 ; i < files.length; i++ ) {
  9. search( files[i] );
  10. } if (f.length() <= 1) return;
  11. }
  12.  
  13.  
  14. }
  15. }

well to the code ive added the following line:


if (f.length() <= 1) return;


but i dont think it has had any change in the list of results brought to the terminal window

can some one with more java knowledge tell me why please? any help or correction welcomed!
Last edited by caps_lock; Jan 11th, 2009 at 8:14 pm.
Reply With Quote