• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to delete an empty file using File.delete()

 
srinivas daroori
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Due to some of the operations in my program, Few files will get created among them some may be of zero bytes in case of no errors, but they will just get created.
At the end, in the process of cleanup, I am trying to delete all the above created files. I am not able to delete those files which are of zero bytes in size using delete() method in File class.
Any idea how to delete these files with zero size?
 
clio katz
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tried File.deleteOnExit() yet?
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...which will delete files, unrelated to their size...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!