IntelliJ Java IDE
The moose likes Tomcat and the fly likes Can't delete file in Tomcat directory Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "Can Watch "Can New topic
Author

Can't delete file in Tomcat directory

Steven Ho
Greenhorn

Joined: Jan 16, 2003
Posts: 15
Hello,
I have a file in
C:\tomcat\tomcat-4-1\webapps\test\WEB-INF\storage\dataindex.tbl
I am trying to delete it using new (File(filepath)).delete(); without successing. I have to manually shutdown Tomcat, and delete the file, if I didn't shutdown Tomcat, windows 2k will display "sharing violation" message.
What can I do to delete the file smoothly?
Any help is appreciated, Thanks.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 11863
Sure sounds like some program is still using that file - you need to figure out which one.
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

under *nix, you probably wouldn't have this problem.

I find that once you reference a file in Tomcat, it seems to be 'locked' until Tomcat goes away (under Windows)
 
IntelliJ Java IDE
 
subject: Can't delete file in Tomcat directory
 
Threads others viewed
Un-install tomcat.
JAR file is locked when doing a remove
war file deployment on tomcat startup, doesnt always work.
SAXParseException: Content is not allowed in prolog.
shutdown error
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com