• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to delete tmp file in the case of abort. Finally block is not in the scope

 
George Cui
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


when it abort the tmp file is still in the folder.
How to delete the tmp file in case?
thanks
 
Paul Clapham
Sheriff
Posts: 21111
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You just need to declare the variable in a scope which includes both the try-block and the finally-block.
 
George Cui
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, after adding
File tmp_file = null;
at the top, it works
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic