Hi, I'm working on a problem with POP mail retrieval which surfaced during the weekend. This question refers to ETH Oberon / PC Native 05.01.2003. I haven't looked for the analogue in Aos but a similar concept must be there. According to my understanding, the purpose of GetUIDLs is to retrieve a list of message UIDLs from a POP server; one UIDL per message. PROCEDURE GetUIDLs(S: NetTools.Session; VAR T: Texts.Text); VAR F: Files.File; R: Files.Rider; BEGIN SendCmd(S, "UIDL", ""); IF ReadState(S) THEN F := Files.New(""); Files.Set(R, F, 0); ReadText(S, R); NEW(T); Texts.LoadAscii(T, F) ELSE T := NIL END END GetUIDLs; Files.New("") creates an anonymous file. What becomes of this file when GetUIDLs exits? Why is the file involved rather than the data from Session put directly into T? Thanks, ... Peter E. -- Telephone 1 360 639 0202. Former telephone 1 360 450 2132. bcc: peasthope ... shaw.ca "http://carnot.yi.org/" "http://members.shaw.ca/peasthope/index.html#Itinerary"
Hello!
PROCEDURE GetUIDLs(S: NetTools.Session; VAR T: Texts.Text); VAR F: Files.File; R: Files.Rider; BEGIN SendCmd(S, "UIDL", ""); IF ReadState(S) THEN F := Files.New(""); Files.Set(R, F, 0); ReadText(S, R); NEW(T); Texts.LoadAscii(T, F) ELSE T := NIL END END GetUIDLs;
Files.New("") creates an anonymous file. What becomes of this file when GetUIDLs exits? Why is the file involved rather than the data from Session put directly into T?
The anonymous file will be garbage-collected at a later time. I would guess that Texts.LoadAscii contains some important data conversion, e.g. it may ensure that there are no garbage characters, etc. One has to look at the procedure to find out. ---=====--- Alexander
This code has the same interpretation under V4 or Component Pascal, so I think my comment will be true for the ETH / PC Native. A Text is not a sequence of bytes. It is more abstract than a file is. It is a sequence of "Runs" where each run has attributes such as font, color, length, and a source file and the starting position. This structure makes it very fast to copy from one viewer to another. When a Text is saved to a file, the separate runs are all written anew to that file. At that time it is very easy to confuse the concepts of Text and File, so I always try to think of a text that is displayed in a viewer after it has had items copied from other texts whenever I am writing code. So, there has to be a file that is referenced in the Run data structure. In this code snippet, the new anonymous file is created to fill that role. In Component Pascal, Converters all appear to contain code that looks almost identical this. On Tue, Jan 17, 2012 at 6:38 PM, <peasthope@shaw.ca> wrote:
Hi,
I'm working on a problem with POP mail retrieval which surfaced during the weekend. This question refers to ETH Oberon / PC Native 05.01.2003. I haven't looked for the analogue in Aos but a similar concept must be there.
According to my understanding, the purpose of GetUIDLs is to retrieve a list of message UIDLs from a POP server; one UIDL per message.
PROCEDURE GetUIDLs(S: NetTools.Session; VAR T: Texts.Text); VAR F: Files.File; R: Files.Rider; BEGIN SendCmd(S, "UIDL", ""); IF ReadState(S) THEN F := Files.New(""); Files.Set(R, F, 0); ReadText(S, R); NEW(T); Texts.LoadAscii(T, F) ELSE T := NIL END END GetUIDLs;
Files.New("") creates an anonymous file. What becomes of this file when GetUIDLs exits? Why is the file involved rather than the data from Session put directly into T?
Thanks, ... Peter E.
-- Telephone 1 360 639 0202. Former telephone 1 360 450 2132. bcc: peasthope ... shaw.ca "http://carnot.yi.org/" "http://members.shaw.ca/peasthope/index.html#Itinerary"
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
-- Aubrey McIntosh, Ph.D. 1502 Devon Circle Austin TX 78723-1814 http://home.grandecom.net/~amcintosh/aubrey/Search/ 512-348-7401
From: Alexander Iljin <ajsoft@yandex.ru> Date: Wed, 18 Jan 2012 10:08:46 +0400
The anonymous file will be garbage-collected at a later time.
Garbage collection for direct access memory is mentioned often. Is "garbage collect" the right term for this salvaging of a disused anonymous file? From: <Aubrey.McIntosh@Alumni.UTexas.Net> Date: Wed, 18 Jan 2012 01:16:06 -0600
A Text is not a sequence of bytes. ... It is a sequence of "Runs" where each run has attributes such as font, color, length, ...
So far, so good.
... and a source file and the starting position.
I'll have to review that in the Oberon System book. Conceptually I don't understand why a Text should be attached to a file. What if a Text is created in memory and never read from or written to a file?
In this code snippet, the new anonymous file is created to fill that role.
With no offense intended, what role? What is the need or benefit? Tue, Jan 17, 2012 at 6:38 PM, <peasthope@shaw.ca> wrote:
I'm working on a problem with POP mail retrieval which surfaced during the weekend.
The problem was merely a redundant blank character emitted in ETHNO POP3. Now fixed and documented here, second paragraph. Desktops.OpenDoc "http://142.103.107.138/OberonPage.html#Mail" Thanks Alexander and Aubrey for the discussion, ... Peter E.
-- Telephone 1 360 639 0202. bcc: peasthope ... shaw.ca "http://carnot.yi.org/" "http://members.shaw.ca/peasthope/index.html#Itinerary"
Hello!
The anonymous file will be garbage-collected at a later time.
Garbage collection for direct access memory is mentioned often. Is "garbage collect" the right term for this salvaging of a disused anonymous file?
The Files.File object is created in memory with NEW, and it will be garbage-collected later. When the object is collected, it finalizes itself by deleting its temporary disk file, if any. (Theoretically, nothing prevents anonymous files from being completely memory-based, it's an implementation detail.) So, the disk file will deleted in the process of garbage-collection. The term "garbage-collection" directly applies to the memory object, and, keeping in mind the finalization process, can be indirectly applied to other resources. PS: Excuse me for the Base64 encoding, if any. I currently use a web interface for emailing, not my regular program. ---=====--- Alexander
participants (3)
-
Alexander Iljin -
Aubrey.McIntosh@Alumni.UTexas.Net -
peasthope@shaw.ca