i’m writing a script that checks if a .sql dump has the end line (dump completed on xx) correct, to validate files after the dump.
The thing is, as the files are pretty big (20GB+), the following method is being killed by the system for using too much ram (the vm right now has 6GB of RAM)
with open(file_path, 'r', encoding='latin1') as file: lines = file.readlines() if lines: last_line = lines[-1].strip()
Is there a way to do this without streaming the file to memory?