home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
archives
/
os2pm.tar.gz
/
os2pm.tar
/
files.def
< prev
next >
Wrap
Text File
|
1990-08-27
|
940b
|
32 lines
DEFINITION MODULE Files; (* File I/O for Kermit *)
FROM FileSystem IMPORT
File;
EXPORT QUALIFIED
Status, FileType, Open, Create, CloseFile, Get, Put, DoWrite;
TYPE
Status = (Done, Error, EOF);
FileType = (Input, Output);
PROCEDURE Open (VAR f : File; name : ARRAY OF CHAR) : Status;
(* opens an existing file for reading, returns status *)
PROCEDURE Create (VAR f : File; name : ARRAY OF CHAR) : Status;
(* creates a new file for writing, returns status *)
PROCEDURE CloseFile (VAR f : File; Which : FileType) : Status;
(* closes a file after reading or writing *)
PROCEDURE Get (VAR f : File; VAR ch : CHAR) : Status;
(* Reads one character from the file, returns status *)
PROCEDURE Put (ch : CHAR);
(* Writes one character to the file buffer *)
PROCEDURE DoWrite (VAR f : File) : Status;
(* Writes buffer to disk only if nearly full *)
END Files.