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

Deleting multiple files at one go  RSS feed

 
RaviSingh Kumar
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a list of filenames present under a directory.

I want to delete all the files from that directrory at one go.

Dont want to iterate the list and delete file one by one.

Thanks in advance
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RaviSingh Kumar wrote:Dont want to iterate the list and delete file one by one.

Why?
 
RaviSingh Kumar
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have more than 10 thousands of files in the list. I dont want to do File I/O every time.
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And yet if you want to delete a file, that file I/O has to be done. Whether you want to do it or not.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!