for_each_line
Mojo function 🡭
for_each_line
➕
➖def for_each_line(path: String, func: T, buf_size: Int = Int(131072))Call the provided callback on each line.
The callback will be given a buffer, and the [start, end) of where the line is in that buffer.
Args:
- path (
String): The file path to open and read. - func (
T): The callback to run for each line, passed as a value. - buf_size (
Int): The size of the buffer to use.
Raises: