scsh-users
[Top] [All Lists]

How to test for end of file?

To: scsh@martigny.ai.mit.edu
Subject: How to test for end of file?
From: back0003 <back0003@gold.tc.umn.edu>
Date: Mon, 15 Jan 1996 14:18:55 -0600 (CST)

Any clues are welcome.

(define (witless-grep)
        (let ((temp-line (read-line my-file)))
          (if (= temp-line end-of-file)          ;; How to test for EOF?
              #t
          (if (string-match my-regular-expression temp-line)
                (begin
                  (write-string temp-line)
                  (newline)
                  (witless-grep))
                (witless-grep)))))

Jan Erik Backlund
back0003@gold.tc.umn.edu

<Prev in Thread] Current Thread [Next in Thread>