• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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. ;)
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
reply
    Bookmark Topic Watch Topic
  • New Topic