in reply to Can't seem to see the problem here...

Hi, a few hints, though I dont have a full solution.

run the file test operators on what you think is a valid typed-in path:

-d $dir -f $dir -e $dir # or just call stat()

you may have to chomp() the input to get rid of the CRLF at the end.