unable to delete file
Hi.... i am using the command below to delete the particular file..... the file exists at that place..... the problem is that the functioning of the command is errqtic....it s not functioning some time ....while at other times it works perfectly.....Cud u pls help me...Thanx
File f = new File("C:/file/i.csv");
f.delete();
> Hi.... i am using the command below to delete the
> particular file..... the file exists at that
> place..... the problem is that the functioning of the
> command is errqtic....it s not functioning some time
> ....while at other times it works perfectly.....Cud u
> pls help me...Thanx
>
> File f = new File("C:/file/i.csv");
> f.delete();
Does the file exist [ f.exists() ] ?
> wats happening is that i am using clover to use read
> the file .... now wen the format of the file is
> correct ... ie as required by clover for execution
> then the functioning is alright..... but if the
> format is not correct then an exception is thrown..
> and the next time it does not function correctly
This almost certainly means that you aren't closing the file when the exception is thrown. Put the close into a finally {} block.
ejpa at 2007-7-14 22:38:18 >
