unclosed files in Java

Small tip: if you don’t close your opened files, you may not be able to delete them using File.delete. If you find you’re in that situation, try to do a System.gc() before the delete call. Sometimes it helps.

If calling the garbage collector doesn’t work, you’ll have to close them from your code.


0 Responses to “unclosed files in Java”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog Stats

  • 238,122 hits

%d bloggers like this: