Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » File delete problem
File delete problem [message #336758] Wed, 01 July 2009 14:26 Go to next message
Kerry Stares is currently offline Kerry StaresFriend
Messages: 7
Registered: July 2009
Junior Member
Running Eclipse on Windows with a custom editor (extends TextEditor) I
have a problem with deleteing a file. If I edit a file and change it,
save the file, close the editor I cannot then delete the file using the
delete from the context menu in the navigator view. I have crawled
through the editor and closed everything that can be closed. The error
comes from the low level W32 delete code. If I wait a few minutes I can
then delete the file.
Does anyone have any suggestions as to what might be causing this
issue please or suggestion on how to resolve it.

Thanks

Kerry Stares
Re: File delete problem [message #336772 is a reply to message #336758] Thu, 02 July 2009 01:15 Go to previous messageGo to next message
Walter Harley is currently offline Walter HarleyFriend
Messages: 847
Registered: July 2009
Senior Member
"Kerry Stares" <kerry@uk.ibm.com> wrote in message
news:h2frm3$4kr$1@build.eclipse.org...
> Running Eclipse on Windows with a custom editor (extends TextEditor) I
> have a problem with deleteing a file. If I edit a file and change it, save
> the file, close the editor I cannot then delete the file using the delete
> from the context menu in the navigator view. I have crawled through the
> editor and closed everything that can be closed. The error comes from the
> low level W32 delete code. If I wait a few minutes I can then delete the
> file.
> Does anyone have any suggestions as to what might be causing this
> issue please or suggestion on how to resolve it.

Sounds like something has an open file handle, that is not being closed
until the object is garbage-collected and its finalizer is called.

Check to make sure that you're properly closing all files, writers, streams,
etc. that you open. Take particular care to check exception exit paths,
e.g., if an exception is thrown (and silently gobbled up by something else,
possibly), is the close() still happening.
Re: File delete problem [message #336909 is a reply to message #336772] Mon, 13 July 2009 06:31 Go to previous message
Kenneth Missing name is currently offline Kenneth Missing nameFriend
Messages: 9
Registered: July 2009
Junior Member
I think I saw a Java bug about this, try running "System.gc();" after
closing the file. This will release all underlying resources locks. At
least worked for me, may not be a suitable workaround in all cases.

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4045014
Previous Topic:Shouldn't autobuild iterate until all builder-produced resource deltas are consumed?
Next Topic:Registers view collapses after stepping
Goto Forum:
  


Current Time: Sat Dec 20 11:35:47 GMT 2014

Powered by FUDForum. Page generated in 0.07593 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software