File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cant delete a file in Vista using java.io.File.delete()

 
Prasad A Nair
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
while trying to delete a file using java.io.File.delete(), it returns true but the file lies intact.

i'm sure there is no handle or stream open on the file..

the same code is running fine in XP..

if anyone can help me.. thanks
 
thejaswini ramesh
Ranch Hand
Posts: 74
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This could be a permission issue as i faced a similar problem while creating a file on vista. That is Windows Vista expects the user to "continue" or "cancel" the file operations.
 
Drews Clausen
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you find a solution for this already?

I'm just facing the same problem right now with delete() and renameTo() and don't know what to do.

There are loads of java programs used by Vista users working fine with java.io, there MUST be a solution or a nice workaround.
 
Rob Spoor
Sheriff
Pie
Posts: 20380
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Turn that pesky User Access Control off comes to mind. It's useless anyway: experienced users know what they are doing so they click it away, and non-experienced users hardly take the time to read it and click OK as well.
 
Drews Clausen
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Prime wrote:Turn that pesky User Access Control off comes to mind. It's useless anyway: experienced users know what they are doing so they click it away, and non-experienced users hardly take the time to read it and click OK as well.


Well, but it wouldn't be a really good solution to tell all users using your programm to turn off UAC, would it?

Anyway: This issue seems to be fixed in some later updates - i kept using Java 6 Update 7, but updated to Java 6 Update 11 a few minutes ago and....*TADAH*, it works. ;)
 
Avyaya Avi
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, does it mean You can not delete the file without Java 6 Update 7???

What if we face the same problem in earlier versions of Java?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic