[Oberon] Streams.

peter at easthope.ca peter at easthope.ca
Thu Apr 22 17:36:36 CEST 2021


Hi, 

Background
Studying Oberon.Mail.Mod in ETH Oberon and use of Streams therein.

I wondered about the purpose and necessity of the Streams module.  
Didn't find an explanation in Oberon.  The comment in A2 is helpful.

MODULE Streams;   (** AUTHOR "pjm/be"; PURPOSE "I/O buffering and formatted writing and reading"; *)

In Oberon.Mail.Mod
  ... 
  PROCEDURE AddMsgHead(pos: SIGNED32);
  ...  
  S := Streams.OpenFileReader(msgsF, pos);

That opens the messages file, msgsF. Appears that the file is not 
closed before "END AddMsgHead".

Is that good practice?  Shouldn't msgsF be closed by the end of the 
procedure?

Opening the msgsF at each reading of the head of a message seems 
inefficient. Why not open the file when the module is loaded?  Then 
set the rider when necessary.

Ref. https://svn.inf.ethz.ch/svn/lecturers/a2/trunk/source/
userid  infsvnh.anonymous
password  anonymous

TIA,                          ... P.



-- 
VoIP: +1 604 670 0140            Bcc: peter at easthope. ca



More information about the Oberon mailing list