[M3devel] Just to prove I've been paying attention for a long time

Mark Wickens mark at wickensonline.co.uk
Mon Jan 17 01:01:36 CET 2011


Thought this might bring a little nostalgia for some - it certainly did 
for me!
Although I only dabbled in Modula-3 I did listen in to the mailing list 
of the time...

 From daemon Tue Nov 14 01:36:05 1995
Status: RO
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
     ["2877" "Mon" "13" "November" "1995" "11:58:44" "-0800" 
"heydon at pa.dec.com" "heydon at pa.dec.com" nil "89" "Re: Modula3 Postcard 
under Linux Slackware 3.0" "^From:" nil nil "11" nil nil (number " " 
mark "     heydon at pa.dec.com Nov 13   89/2877  " thread-indent "\"Re: 
Modula3 Postcard under Linux Slackware 3.0\"\n") nil]
     nil)
Received: from jess.luton.ac.uk by ellen.luton.ac.uk; 
(5.65v3.2/1.1.8.2/09Nov95-0144PM)
     id AA01562; Tue, 14 Nov 1995 01:36:03 GMT
Received: from mail1.digital.com (mail1.digital.com [204.123.2.50]) by 
jess.luton.ac.uk (8.6.12/8.6.9) with SMTP id BAA01082 for 
<msw at luton.ac.uk>; Tue, 14 Nov 1995 01:34:41 GMT
Received: from src-mail.pa.dec.com by mail1.digital.com; (5.65 EXP 
4/12/95 for V3.2/1.0/WV)
     id AA05303; Mon, 13 Nov 1995 17:20:40 -0800
Received: by src-mail.pa.dec.com; id AA27318; Mon, 13 Nov 95 17:19:14 -0800
Received: by src-news.pa.dec.com; id AA07755; Mon, 13 Nov 95 17:19:13 -0800
Received: by src-news.pa.dec.com; id AA07750; Mon, 13 Nov 95 17:19:12 -0800
Newsgroups: comp.lang.modula3
Path: src.dec.com!heydon
Message-Id: <9511131958.AA03371 at juniper.pa.dec.com>
In-Reply-To: m3-request at src.dec.com
Distribution: world
X-Received: by juniper.pa.dec.com; id AA03371; Mon, 13 Nov 1995 11:58:45 
-0800
X-Received: by src-news.pa.dec.com; id AA19102; Mon, 13 Nov 95 11:58:46 
-0800
X-Mts: smtp
Lines: 89
From: heydon at pa.dec.com
To: omalley at ics.uci.edu
Cc: comp.lang.modula3.usenet at pa.dec.com
Subject: Re: Modula3 Postcard under Linux Slackware 3.0
Date: Mon, 13 Nov 95 11:58:44 -0800

Owen,

You asked:

 > However, it is dying in linking Postcard because it can't find
 > getdirentries. I'm not surprised that the linker can't find it,
 > because I can't find it either. (There is an extern definition in the
 > header file, but it doesn't seem to be in any of the libraries.) Am I
 > missing it somewhere? Is there a newer version of libc that actually
 > has getdirentries?

We've fixed the "getdirentries" problem in the sources at SRC, so it
should be included in the next release. In the meantime, you can fix
the problem yourself by removing the following declarations from the
file named "src/OSUtils.m3" in the "postcard" package:

FROM Utypes IMPORT u_short, ino_t;

CONST
   MaxDirNameLen = 64;

TYPE
   DirEntry = RECORD    (* directory types somehow missing from Unix.i3 *)
     d_ino: ino_t;
     d_reclen: u_short;
     d_namelen: u_short;
     d_name: ARRAY [0..MaxDirNameLen-1] OF CHAR;
   END;

<*UNUSED*>
PROCEDURE OldEnumerate (path: Text.T): TextList.T RAISES {FileError} =
   VAR
     head: TextList.T := NIL;
     tail, this: TextList.T;
     t: TEXT;
     length: int;
     buffer: ARRAY [0..1023] OF CHAR;
     de: UNTRACED REF DirEntry;
     pbase: long;
     i: INTEGER;
     p := ConvertPath(path);
     f := Unix.open(p, Unix.O_RDONLY, 0);
   BEGIN
     IF f < 0 THEN RAISE FileError(ErrorMessage(Uerror.errno)); END;
     TRY
       LOOP
         length := Unix.getdirentries(
           f, ADR(buffer), BYTESIZE(buffer), pbase);
         IF length < 0 THEN RAISE FileError(ErrorMessage(Uerror.errno)); 
END;
         IF length = 0 THEN EXIT; END;
         i := 0;
         LOOP
           de := LOOPHOLE(ADR(buffer[i]), UNTRACED REF DirEntry);
           IF (de^.d_ino # 0) THEN
             t := M3toC.CopyStoT (ADR(de^.d_name));
             IF NOT (Text.Equal (t, ".") OR Text.Equal (t, "..")) THEN
               this := TextList.Cons(t, NIL);
               IF head = NIL THEN
                 head := this;
               ELSE
                 tail.tail := this;
               END;
               tail := this;
             END;
           END;
           INC(i, de^.d_reclen);
           IF i >= length THEN EXIT; END;
         END;
       END;
     FINALLY
       EVAL Unix.close(f);
     END;
     RETURN head
   END OldEnumerate;

The call to "getdirentries" is in the "OldEnumerate" procedure, but
that procedure is never called. The other IMPORT, CONST, and TYPE
declarations are only used by "OldEnumerate", so they should be removed
to keep the compiler from issuing a warning.

Let me know if you apply this patch and still have any problems.

- Allan

--------------------------------------------------------------------
Allan Heydon                           Digital Equipment Corporation
heydon at pa.dec.com                      Systems Research Center
(415) 853-2142                         130 Lytton Avenue
(415) 853-2104 (FAX)                   Palo Alto, CA 94301



More information about the M3devel mailing list