check rmdir to be non-empty, check if rm is not directory