Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » File delete problem
File delete problem [message #336758] Wed, 01 July 2009 10:26 Go to next message
Eclipse UserFriend
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] Wed, 01 July 2009 21:15 Go to previous messageGo to next message
Eclipse UserFriend
"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 02:31 Go to previous message
Eclipse UserFriend
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: Tue Mar 11 14:43:11 EDT 2025

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

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

Back to the top