• Post Reply Bookmark Topic Watch Topic
  • New Topic

Deleting multiple files at one go

 
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: 65524
105
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: 21889
36
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!