I was having an issue where clamdscan would mark any files as OK even if they were viruses (EICAR). This is because my TemporaryDirectory did not exist.
Once I made sure the TemporaryDirectory exists clamdscan worked without a problem.
I hope that helps someone else. I could not find any documentation or solutions online.