Do we want `rmdir_recursive()` to return an error if it's called on a file, or do we want to just delete the file? I'm inclined to think the latter is a good idea, and in that case we need to stat the input first before trying to treat it as a directory.