When you try to see if a file exists then you can use
File.exists()
as here:
public int existsFile(){
/**
* @author Me
* @descr This function check if the file exists
*/
int x = 0; // 0 - file doesn't exist
// 1 - file do exists
String name_path_file = "C:/temp/myFile.tmp";
File fisier = new File(name_path_file);
if(fisier.exists()){
x = 1;
}
return x;
}
No comments:
Post a Comment