程序是顺序执行的,你没有判断文件是否存在
if(myDir.exists())
if(myfile.exists())