home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / lisp / 3140 < prev    next >
Encoding:
Text File  |  1992-12-26  |  1005 b   |  32 lines

  1. Newsgroups: comp.lang.lisp
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!rpi!news.columbia.edu!cunixb.cc.columbia.edu!rs69
  3. From: rs69@cunixb.cc.columbia.edu (Rong Shen)
  4. Subject: a problem with reading a stream
  5. Message-ID: <1992Dec27.014528.17943@news.columbia.edu>
  6. Sender: usenet@news.columbia.edu (The Network News)
  7. Nntp-Posting-Host: cunixb.cc.columbia.edu
  8. Organization: Columbia University
  9. Date: Sun, 27 Dec 1992 01:45:28 GMT
  10. Lines: 20
  11.  
  12. Hi experts:
  13.  
  14.     I am trying to write a function that asks a path to a file
  15. from the user and opens the file to read. There is no problem with
  16. opening the file, but when it tries to read, the interpreter
  17. complains.
  18.  
  19.     Can anyone tell me why?
  20.  
  21.     Thanks very much.
  22.  
  23. --
  24. rs69@cunixb.cc.columbia.edu
  25.  
  26. (defun read-path ()
  27.   (format t "Enter the path to the file to read, e.g. /tmp/foo/faq.txt")
  28.   (setf file-path-name (read-line))
  29.   (setf what-stream (open file-path-name :direction :input)) ; ok
  30.  
  31.   (read what-stream nil 'This-is-the-end-of-the-world)) ; This line has error;
  32.