Either by checking if it ends with a "/" or use a function like folder-p
Either by checking if it ends with a "/" or use a function like folder-p