Throw if path argument is directory