Use file compare instead of creating hashes

+ fix too many open file error