deals with nonexistant command line files
checks that maxdepth argument is valid