Deleting used file

I want ot delete file but as my program use it i can't to that how can make my program didn't use it and delete the file?
[130 byte] By [Elnegma] at [2007-10-2 11:49:21]
# 1

> I want ot delete file but as my program use it i

> can't to that how can make my program didn't use it

> and delete the file?

It's difficult to understand what you are trying to say. The simplest thing I could think of: Since your program is using the file [if you would elaborate on what you mean by that], stop using it. That might probably mean closing the streams.

aniseeda at 2007-7-13 6:21:24 > top of Java-index,Java Essentials,Java Programming...
# 2
I don't understand what you're saying about why you can't, but java.io.File.delete() is how you do it. You have to have closed any streams first though. I think I've heard of problems of it not working very reliably on Windows, but I haven't paid close attention.
jverda at 2007-7-13 6:21:24 > top of Java-index,Java Essentials,Java Programming...
# 3

>I don't understand what you're saying about why you can't, but >ava.io.File.delete() is how you do it. You have to have closed any >treams first though. I think I've heard of problems of it not working very >eliably on Windows, but I haven't paid close attention.

i used delete method but he didn't delete the file and retuen false as ComboBox using that file so how can i make that ComboBox didn't use it?

Elnegma at 2007-7-13 6:21:24 > top of Java-index,Java Essentials,Java Programming...
# 4
> i used delete method but he didn't delete the file> and retuen false as ComboBox using that file so how> can i make that ComboBox didn't use it?Close whatever streams that combobox has open on tha file, I guess.
jverda at 2007-7-13 6:21:24 > top of Java-index,Java Essentials,Java Programming...
# 5
>Close whatever streams that combobox has open on tha file, I guessHow can i close astream?
Elnegma at 2007-7-13 6:21:24 > top of Java-index,Java Essentials,Java Programming...
# 6

> >Close whatever streams that combobox has open on tha

> file, I guess

> How can i close astream?

By invoking the appropriate method of course.

Assuming you have some kind of InputStream object (or OutputStream, etc), there is a close() method which you are responsible for invoking when done with it.

warnerjaa at 2007-7-13 6:21:24 > top of Java-index,Java Essentials,Java Programming...
# 7
Thanks my dear friend warnerja its worked
Elnegma at 2007-7-13 6:21:24 > top of Java-index,Java Essentials,Java Programming...