DIRECTORY File, Rope, IO, TiogaNode; PutGet: CEDAR DEFINITIONS = BEGIN Offset: TYPE = TiogaNode.Offset; MaxLen: Offset = LAST[Offset]; Ref: TYPE = TiogaNode.Ref; RefBranchNode: TYPE = TiogaNode.RefBranchNode; ROPE: TYPE = Rope.ROPE; ToFile: PROC [fileName: ROPE, node: Ref, start: Offset _ 0, textOnly: BOOL _ FALSE] RETURNS [dataLen, count: Offset]; ToFileC: PROC [file: File.Capability, node: Ref, start: Offset _ 0, textOnly: BOOL _ FALSE] RETURNS [dataLen, count: Offset]; FromFile: PROC [fileName: ROPE, start: Offset _ 0, len: Offset _ MaxLen] RETURNS [Ref]; FromFileC: PROC [file: File.Capability, start: Offset _ 0, len: Offset _ MaxLen] RETURNS [Ref]; FromFileError: ERROR; WriteMesaFilePlain: PROC [fileName: ROPE, root: RefBranchNode]; WriteFilePlain: PROC [fileName: ROPE, root: RefBranchNode]; WriteFileCPlain: PROC [file: File.Capability, root: RefBranchNode]; ToRope: PROC [node: Ref, textOnly: BOOLEAN _ FALSE] RETURNS [dataLen, count: Offset, output: ROPE]; FromRope: PROC [rope: ROPE, start: Offset _ 0, len: Offset _ MaxLen] RETURNS [Ref]; WriteRopePlain: PROC [node: RefBranchNode] RETURNS [output: ROPE]; ToStream: PROC [stream: IO.Handle, node: Ref, textOnly: BOOL _ FALSE] RETURNS [dataLen, count: Offset]; FromStream: PROC [stream: IO.Handle, len: Offset _ MaxLen] RETURNS [Ref]; END. >PutGet.mesa; written by Bill Paxton, May 1981 edited by McGregor. February 14, 1983 10:03 am Last Edited by: Paxton, August 17, 1983 9:53 am File Input/Output write the node on the specified file starts writing at given address in file returns dataLen = number of data bytes at start of file, and count = the total number of bytes written create node from the contents of a file starts reading at given start address in file pretends that start+len is the end of the file if file was not created by ToFile (i.e., password not correct) then returns a simple document containing the ASCII contents of the file This is like WriteFilePlain, but adds initial dashes to comments if necessary. gives text of file with CR after each node and TABs before according to nesting Input/Output using ropes instead of files resulting rope contains same representation of node as would be put on file reads rope to construct node IO Operations does a series of IO.PutBlock's returns number of bytes written reads up to len chars from stream (via GetBlock's) to construct a node ʧ˜JšÏc-™-Jš.™.Jšœœ™/J˜šÏk ˜ J˜J˜Jšžœ˜J˜ —J˜Jšœžœž˜!J˜Jšœžœ˜ Jšœžœ ˜Jšœžœ˜Jšœžœ˜.Jšžœžœžœ˜J˜Jš™˜š Ïnœžœ žœ*žœžœ˜SJšžœ˜!J˜—šŸœžœAžœžœ˜[Jšžœ˜!Jš%™%Jš(™(š9™9Jš.™.J˜——šŸœžœ žœ+žœ˜WJ˜—šŸ œžœA˜PJšžœ˜Jš(™(Jš.™.Jš/™/š?™?JšI™I—J˜—šœžœ˜J˜—šŸœžœ žœ˜?Jšœ Ÿœ3™NJ™—šŸœžœ žœ˜;J˜—šŸœžœ.˜CJšP™P—J˜—Jš)™)˜šŸœžœžœžœ˜3Jšžœ"žœ˜/JšL™LJ˜—šŸœžœžœ+žœ˜SJš™J˜—JšŸœžœžœ žœ˜B˜J˜——š ™ J˜š Ÿœžœ žœžœžœ˜EJšžœ˜!Jš™Jš ™ J˜—šŸ œžœ žœžœ˜IJšG™G——J™Jšžœ˜J˜—…—2