Handle errors

This commit is contained in:
Sean C 2023-04-17 00:33:35 -04:00
parent da49b29471
commit d282e8d5d6

View File

@ -5,12 +5,15 @@ directories = os.listdir('.') ## Get the files in the current directory
files = [] files = []
def quickhash(filefullpath): def quickhash(filefullpath):
with open(filefullpath, "rb" ) as f: try:
md5 = hashlib.md5() with open(filefullpath, "rb" ) as f:
block_size=1024*100 md5 = hashlib.md5()
data = f.read(block_size) block_size=1024*100
md5.update(data) data = f.read(block_size)
return md5.digest() md5.update(data)
return md5.digest()
except OSError as er:
print(f"Error hashing {filefullpath}")
def direcCrawler(): def direcCrawler():
global directories, files global directories, files