import winim/lean

proc fileExists(filename: cstring): bool =
  result = GetFileAttributesA(filename) != INVALID_FILE_ATTRIBUTES

const
    filename = "C:\\path\\to\\your\\file.txt" # double-\ because it's an escape character.
if fileExists(filename):
  echo "File exists."
else:
  echo "File does not exist."

