I tried to copy all files in drive G:\ to other place.
then i get all files form following command.
and i copy every file one by one.
but every time it gives file not found exception.how this happens.
File f=new File("g:\\");
String[] list = f.list();
void copyFile(String f)
{
try{
File f1 = new File(f);
FileReader fr =new FileReader(f);
BufferedReader br =new BufferedReader(fr);
File file2 = new File("E:\\ana\\"+g);
FileWriter fw =new FileWriter(file2);
String size = br.readLine();
while(!(size==null))
{
System.out.println("br.readLine(); "+size);
size=size+System.getProperty("line.separator");
fw.write(size);
size=br.readLine();
}
}
catch(Exception e)
{
e.printStackTrace();
}
}