• 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

Delete A Directory

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I am trying to delete a diretory (Files) using java and it is working when i run the respective .class by keeping it out of directory.
But if i keep the .class in the same directory where i am trying to delete , there then it is deleting all other files except the .class and therefore the directory remains as it is.

It will be great if any one could suggest this.

regards
satya
 
Marshal
Posts: 79180
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you expect to delete a directory while its contained files are in use?
 
satya satish
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, this is for like Uninstalling a application.
 
satya satish
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First i created an Executable .jar file, where this will delete ( Clean ) all Files in the Directory(Application) and then finally the Directory(Application).
I placed this .jar inside the Directory, so that to uninstall this Application i click on this .jar.


Thank you
satya
 
Campbell Ritchie
Marshal
Posts: 79180
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't know, I am afraid.

Anybody else?
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you considered copying the jar to a temp location and then executing it from there? Files in the temp location get cleaned up by the OS.
 
satya satish
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, i tried by keeping the jar in temp location(out side of the application ) and it was deleting the Directory, but my requirement is that , the executable jar named "Uninstaller.jar" (which performs deleting the Directory) will be there inside my application under the UnInstaller Folder and it should delete entire Application when i click the uninstaller.jar.


But it is Not working, instead of that it is cleaning all files except the Uninstaller Folder as it is in Progress and so the application is not removed completely.


So any one can help me in doing this ?

thank you
Satya
 
satya satish
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi i'm waiting for a solution so if any one it will be help full.

Once Again the requirement is, Uninstalling the application using java.
 
satya satish
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Friends i'm using Cmdow.exe Command Line Window Utility for hiding, listing, hiding/unhidingminimizing.maximiging,enabling.disabling of Batch files (and for Other purposese also) i used this cmdow.exe in my application diirectly when installing my application . But sometimes in someother machines while it is being installing it is identified as Virus, this is Becuase the Anti Virus makers decided to destroy because of its hiding a file feature.


So i'm looking for alternate for cmdow.exe
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please use UseOneThreadPerQuestion.
 
Mo-om! You're embarassing me! Can you just read a tiny ad like a normal person?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic