if __name__ == '__main__': main()
def calculate_file_hash(file_path): """Calculate SHA-256 hash of a file.""" hash = hashlib.sha256() with open(file_path, 'rb') as f: while True: chunk = f.read(4096) if not chunk: break hash.update(chunk) return hash.hexdigest() check for corrupt files
Checking for corrupt files is a mix of observation, built-in OS tools, and third-party utilities. Start with simple tests (open in another app, compute hash), then escalate to disk scans and repair software. The best fix, however, is always a . built-in OS tools
chkdsk C: /f /r