Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

deleting directory

 
Vaibhav Deshpande
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to delete directory structure. but method delete() is not working since the files in this directory are not empty.
Is there any way to delete dir.
thanks in advance.
vebs
 
Carlos Failde
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to delete the files inside the directory before you can delete it. The contents may include directories which themselves might be nonempty so you are faced with the same problem.

The method first deletes the directory's contents and then finally deletes the directory itself. The method is recursive - if any of the contents are directories then they are in turn deleted in the same way.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic