check that -f gets a file and -d a directory