Correctly hashing files but not directories

Cannot hash directory, permission denied, looking for how to skip
hashing a directory