Answers for "# check if file exists"

20

c# check file exists

if (File.Exists(@"D:\myfile.txt")) {
   Console.WriteLine("The file exists.");
}
Posted by: Guest on February-03-2020
2

check if file exist c#

if(File.Exists(@"C:\file.exe"))
{
    Console.WriteLine("This file exists!");
}
else
{
  Console.WriteLine("This file does not exist!");
}
Posted by: Guest on September-29-2021
0

# check if file exists

# check if file exists
from os.path import exists
file_exists = exists("/content/sample_data/california_housing_test.csv")
print(file_exists)
#True

from pathlib import Path
path = Path("/content/sample_data/california_housing_test.csv")
path.is_file()
#False
Posted by: Guest on March-26-2022

Python Answers by Framework

Browse Popular Code Answers by Language