Sith check isfile

Target in `random` must be a directory, otherwise an IndexError is raised.

(Or maybe the script should be changed to accept files too...)