(* Copyright (C) 1989, Digital Equipment Corporation *) (* All rights reserved. *) (* See the file COPYRIGHT for a full description. *) (* Last modified on Wed Mar 21 22:10:41 1990 by muller *) (* The FileStream interface provides simple routines for opening files. The detailed semantics of the file system vary greatly from system to system, so it is to be expected that this interface will grow in different directions in different systems. But all systems should be able to implement the following very weakly-specified interface, and thereby provide a measure of portability for simple clients. The interface doesn't specify whether the readers and writers returned by the procedures are seekable or buffered. Probably readers and writers to disk files are seekable and buffered, but in general this depends on the system. Similarly, none of the procedures in the interface have raises clauses, since the errors they can raise are system-dependent. Closing a file reader or writer closes the underlying file. *) INTERFACE FileStream; IMPORT Rd, Wr; PROCEDURE OpenRead(n: TEXT): Rd.T; (* Return a reader whose source is the contents of the file named n. *) PROCEDURE OpenWrite(n: TEXT): Wr.T; (* Return a writer whose target is the contents of the file named n. If the file does not exist it will be created; if it does exist it will be truncated to length zero. *) PROCEDURE OpenAppend(n: TEXT): Wr.T; (* Return a writer whose target is the contents of the file named n. If the file does not exist it will be created; if it does exist then the writer will be positioned to append to the existing contents of the file. *) END FileStream.