- read-file #!optional INP-OR-FIL READ MAXprocedure
Reads from the INP-OR-FIL, a file string or input-port, until the end and returns the result as a list, using the supplied reader procedure READ, upto MAX times. Defaults to (current-input-port), read, and #f (entire file).
A wrapper for (chicken io) read-list.
- Example
(import (chicken base) (only (chicken io) read-line) (only (chicken port) with-input-from-string) (only (list-utils operations) read-file)) ;as a list-of string (with-input-from-string "abc\ncbs\n" (cut read-file #f (cut read-line <> 2))) ;=> ("ab" "c" "cb" "s")