in reply to file with a blank in its name

You want to use readdir instead. You should just be able to replace the (<*>) construct with that (you'll need to open a directory handle first, though).