file system check if file exists code example
Example 1: c# check file exists
if (File.Exists(@"D:\myfile.txt")) {
Console.WriteLine("The file exists.");
}
Example 2: check if a file exists
>>> import os
>>> os.path.isfile("d:\\Package1\\package1\\fibo.py")
True
>>> os.path.isfile("d:/Package1/package1/fibo.py")
True
>>> os.path.isfile("d:\\nonexisting.txt")
Example 3: if file exist
file_exists ( string $filename ) : bool