zsh check if file exists

C++
FILE=/etc/resolv.conf
if [[ -f "$FILE" ]]; then
    echo "$FILE exists."
fi

Source

Also in C++: