Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Chapter 6 - page 456 - search.list()  RSS feed

 
fadi aboona
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
The following code:



The following output:


why it wouldn't show subSubDir directory?
i hope the answer is not something silly i overlooked!!
Thank you.
 
Shaikh Ali
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe search.list() only returns the contents of newDir only, not its subfolders. You can write an elegant recursive function to achieve what you want
 
fadi aboona
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Faraz Kadri wrote:I believe search.list() only returns the contents of newDir only, not its subfolders. You can write an elegant recursive function to achieve what you want


Thank you,
but in this case i have to create a file for each directory? maybe i'm thinking ahead of myself here! i think this is achievable with collections!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!