Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!spool.mu.edu!snorkelwacker.mit.edu!ai-lab!zurich.ai.mit.edu!jaffer From: jaffer@zurich.ai.mit.edu (Aubrey Jaffer) Newsgroups: comp.lang.scheme Subject: Re: open-input-file [topics from hell, part 2] Message-ID: Date: 24 Apr 91 02:16:10 GMT References: <9104211907.AA25632@august> Sender: news@ai.mit.edu Organization: M.I.T. Artificial Intelligence Lab. Lines: 18 In-reply-to: carlton@scws1.harvard.edu's message of 23 Apr 91 19:51:55 GMT How about this as a solution: The open-xxx functions would return special ports if the file could not be opened. These special ports all have reached end-of-file or are closed (I am not sure which is better). These special ports are the value of the symbols: file-does-not-exist path-does-not-exist insufficient-priveledge-to-access-file insufficient-priveledge-to-access-path file-system-unavailable The error conditions can be checked for by (eq? file-does-not-exist port) and so on. This plan has the open functions always returning a port and allows those who want to check to do so. For those who don't check end-of-files await.