Re: Problem with java.io.File and Multi - Threads




"Vishal" <vdedaniya@xxxxxxxxx> wrote in message news:1141705063.585423.224600@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Roeby,

removeFiles() is user define function name, which is internally calling
File.delete() method only.

No, i am not deleting an already deleted file.

No, each threads has diff files, so there is no questions of locking
and all.

Thanks for your reply.... but i got solution for these issues.

When i called System.gc() before deleting any files then its working
fine for me. I don't know the logical reason but now its working fine
for me. ;)

"I don't know why, but it's working now, so let's ignore it" is an okay strategy for single threaded programs, but can lead to big problems for multithreaded programs. I advise you to investigate further.

- Oliver

.



Relevant Pages

  • Re: Problem with java.io.File and Multi - Threads
    ... removeFilesis user define function name, which is internally calling ... i am not deleting an already deleted file. ... No, each threads has diff files, so there is no questions of locking ...
    (comp.lang.java.softwaretools)
  • Re: Problem with java.io.File and Multi - Threads
    ... the basic method is called File.delete. ... What is removeFiles? ... Is the problem you are deleting an already deleted file? ...
    (comp.lang.java.softwaretools)
  • Re: Trash Can
    ... Keith wrote: ... deleting a file from within a program. ... In other words when I use i.e DosDelete() how can I make sure a copy of the ... deleted file goes to the Trash Can for eventual recovery later. ...
    (comp.os.os2.programmer.misc)