| Author |
JAVA I/O
|
Jerret Halter
Ranch Hand
Joined: Feb 03, 2006
Posts: 62
|
|
I am trying to work with deleting files and directories in Java 5 but have been unsuccessful. With the following code below a file and directory is created but I cannot delete them. Is there something I am doing wrong?
|
Jerret Halter<br /> <br /> <blockquote><font size="1" face="Verdana, Arial">quote:</font><hr>If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime.<hr></blockquote>
|
 |
Keith Lynn
Ranch Hand
Joined: Feb 07, 2005
Posts: 2341
|
|
|
Remember that Windows locks files when they are open. Because you don't close the BufferedReader before you try to delete the file, it won't delete. Close the BufferedReader first, and it will delete.
|
 |
Jerret Halter
Ranch Hand
Joined: Feb 03, 2006
Posts: 62
|
|
Fantastic :-) Thank you for the help
|
 |
 |
|
|
subject: JAVA I/O
|
|
|