Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java Thread  RSS feed

 
reena Mehta
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

i just want to write a thread that delete a file from given folder
please help me
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why a thread? Deleting a file should be such a quick operation that doing it in a thread seems like unnecessary overhead.
 
Joe Ess
Bartender
Posts: 9414
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I could see a long-lived thread that monitors a directory and cleans up after some other process. Of course, a scheduler like cron or quartz may make more sense.
Our friend needs to TellTheDetails of what he's trying to do for us to be more help.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!