can now either take a file or a dir as argument