file-in-directory-p

file-in-directory-p is a compiled Lisp function in `files.el'.

(file-in-directory-p FILE DIR)

Return non-nil if FILE is in DIR or a subdirectory of DIR.
A directory is considered to be "in" itself.
Return nil if DIR is not an existing directory.