Handle errors
This commit is contained in:
parent
da49b29471
commit
d282e8d5d6
@ -5,12 +5,15 @@ directories = os.listdir('.') ## Get the files in the current directory
|
||||
files = []
|
||||
|
||||
def quickhash(filefullpath):
|
||||
with open(filefullpath, "rb" ) as f:
|
||||
md5 = hashlib.md5()
|
||||
block_size=1024*100
|
||||
data = f.read(block_size)
|
||||
md5.update(data)
|
||||
return md5.digest()
|
||||
try:
|
||||
with open(filefullpath, "rb" ) as f:
|
||||
md5 = hashlib.md5()
|
||||
block_size=1024*100
|
||||
data = f.read(block_size)
|
||||
md5.update(data)
|
||||
return md5.digest()
|
||||
except OSError as er:
|
||||
print(f"Error hashing {filefullpath}")
|
||||
|
||||
def direcCrawler():
|
||||
global directories, files
|
||||
|
||||
Loading…
Reference in New Issue
Block a user