Resetting a file rider without creating a new stream.
Hi, I'm interested to add this procedure to the Oberon Mail module. PROCEDURE WriteMsgLine(CONST no: SIGNED32); VAR len, pos: SIGNED32; h: MIME.Header; cont: MIME.Content; str: ARRAY BufLen OF CHAR; strm: Streams.Stream; BEGIN Texts.WriteString(W, "Mail.Show "); Texts.WriteInt(W, no, msgNoWidth); Texts.Write(W, " "); strm := Streams.OpenFileReader(msgsF, msgs[0].pos); strm.mode := Streams.binary; Files.Set(strm.R, msgsF, msgs[no].pos); ... END WriteMsgLine; No problem with the two lines following BEGIN. The third line is meant to reposition the rider on msgsF but it fails to compile. A FileStream extends a Stream and has rider R. A Stream does not have a rider and consequently strm.R is meaningless. A new stream with new rider can be created but changing the rider in the existing stream would be more efficient. Is there a way change the rider without creating a new stream. Thx, ... P.L. -- VoIP: +1 604 670 0140 Bcc: peter at easthope. ca
Assuming you're talking about Ulm's Streams module, described at http://www.mathematik.uni-ulm.de/oberon/0.5/lib/man/Streams.html, it looks like you want the third line to be something along the lines of: Streams.Seek(strm, msgs[no].pos, Streams.fromStart); On Fri, 23 Apr 2021 19:12:27 -0700, peter@easthope.ca wrote: Hi, I'm interested to add this procedure to the Oberon Mail module. PROCEDURE WriteMsgLine(CONST no: SIGNED32); VAR len, pos: SIGNED32; h: MIME.Header; cont: MIME.Content; str: ARRAY BufLen OF CHAR; strm: Streams.Stream; BEGIN Texts.WriteString(W, "Mail.Show "); Texts.WriteInt(W, no, msgNoWidth); Texts.Write(W, " "); strm := Streams.OpenFileReader(msgsF, msgs[0].pos); strm.mode := Streams.binary; Files.Set(strm.R, msgsF, msgs[no].pos); ... END WriteMsgLine; No problem with the two lines following BEGIN. The third line is meant to reposition the rider on msgsF but it fails to compile. A FileStream extends a Stream and has rider R. A Stream does not have a rider and consequently strm.R is meaningless. A new stream with new rider can be created but changing the rider in the existing stream would be more efficient. Is there a way change the rider without creating a new stream. Thx, ... P.L. -- VoIP: +1 604 670 0140 Bcc: peter at easthope. ca -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
On Sat, 24 Apr 2021 at 06:52, <strohm@airmail.net> wrote:
Assuming you're talking about Ulm's Streams module, described at http://www.mathematik.uni-ulm.de/oberon/0.5/lib/man/Streams.html, it looks like you want the third line to be something along the lines of:
Hello "Strohm". I do not want to be a pain, but may I ask you to please use plain-text email? Also, bottom-posting is the norm on Internet communities and mailing lists. Your reply should go _below_ the trimmed text to which you are replying. More info: https://useplaintext.email/ -- Liam Proven – Profile: https://about.me/liamproven Email: lproven@cix.co.uk – gMail/gTalk/gHangouts: lproven@gmail.com Twitter/Facebook/LinkedIn/Flickr: lproven – Skype: liamproven UK: +44 7939-087884 – ČR (+ WhatsApp/Telegram/Signal): +420 702 829 053
participants (3)
-
Liam Proven -
peter@easthope.ca -
strohm@airmail.net