(use-modules (ice-9 match)
             (ice-9 rdelim))

(define (file-lines-match? file prefix)
  (with-input-from-file file
    (lambda ()
      (catch 'found
        (lambda ()
          (let loop ()
            (match (read-line)
              ((? eof-object?) #false)
              (line
               (if (string-prefix? prefix line)
                   (throw 'found)
                   (loop))))))
        (lambda _ #true)))))

Generated by Ricardo Wurmus using scpaste at Fri Feb 5 09:48:17 2021. CET. (original)