allow providing a directory, mark as file or directory