• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

list of files in a directory

 
geet kaur
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
guys just confused aboout one thing...when i m using the list() while searching then shouldn't it display all the files in the directory and its subdirectories?
i know its a simple quest but still i am revolving around thid...please help!
thanks
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No you will only see the files and folders inside the filepath you are in.

File API - public String[] list()

Returns:
An array of strings naming the files and directories in the directory denoted by this abstract pathname. The array will be empty if the directory is empty. Returns null if this abstract pathname does not denote a directory, or if an I/O error occurs.
 
Rob Spoor
Sheriff
Pie
Posts: 20514
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you need the files of the sub directories as well you will need to call list() on all the sub directories as well, and on its sub directories, etc.
 
geet kaur
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks guys!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic