• 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

Trouble with File delete() method on Win XP

 
Saloon Keeper
Posts: 10732
86
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows ChatGPT
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a large project that is built using ANT (all of which I inherited). During the build a temp directory is created and several jar files are copied there from other projects.

The problem started with the ANT 'clean' target not being able to delete these files. So I wrote a couple of lines of Java which open the temp directory and loop through the files to delete them. The delete() method of File was returning false. So I added a security check above it and it through an exception saying that I had no access permission.

Next step was to use Windows Explorer to see if these were read only. When I looked at the properties for the files they were not marked as 'read only'. The directory that contains them, however, had the 'read only' check box with a light gray square in it (no actual check mark).

Next I used the command line 'attrib' command to see if they were hidden or system. Nope.

However, I CAN delete them using the DEL command or right-clicking with Windows Explorer and selecting Delete (?).

I rebooted to make sure no zombie processes were holding on to them. No luck. I did a file system check. No luck.

We use Subversion for the project with Tortoise SVN installed on our XP boxes. I am set up with administer privileges on my machine. Tortoise SVN clearly indicates that the temp directory is not part of the Subversion collection.

If anyone can shed some light on this I would be extremely grateful.

Ultimately I would like ANT to work like it should, but I would also like to update my Java utility so that it could handle this scenario.

Carey
 
Carey Brown
Saloon Keeper
Posts: 10732
86
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows ChatGPT
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's the delete() method that I wrote inside my utility.

 
Sheriff
Posts: 22784
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
Moving to I/O.
 
Screaming fools! It's nothing more than a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic