SWI-Prolog Did You Know Did you know? SWI-Prolog can lazily parse a file Search Documentation:
Predicate size_memory_file/3