Camm, On Friday, September 15, 2006 11:31 AM you wrote: > > Can we finalize this stat bit please? I'm trying to get 2.6.8 out > ....
I had a bit of trouble with my Windows MSYS/MinGW configuration over the weekend, but now I have got it straight. See the Windows configuration here: http://wiki.axiom-developer.org/BuildAxiom for how I setup the build environment. I needed the following patch to build on Windows because of a difference with lstat (explained in the patch). $ diff -Naur gcl-2.6.8pre_orig/o gcl-2.6.8pre/o diff -Naur gcl-2.6.8pre_orig/o/unixfsys.c gcl-2.6.8pre/o/unixfsys.c --- gcl-2.6.8pre_orig/o/unixfsys.c Sun Sep 17 17:54:43 2006 +++ gcl-2.6.8pre/o/unixfsys.c Wed Sep 20 01:03:44 2006 @@ -34,6 +34,10 @@ #ifdef __MINGW32__ # include <windows.h> +/* Windows has no symlink, therefore no lstat. Without symlinks lstat + is equivalent to stat anyway. */ +# define S_ISLNK(a) 0 +# define lstat stat #endif #ifdef BSD ---------- With this patch applied I was able to build both the CLtL1 and ANSI images. Here are the results of some tests of the new si:stat function: $ saved_gcl GCL (GNU Common Lisp) 2.6.8 CLtL1 Sep 20 2006 02:26:46 Source License: LGPL(gcl,gmp), GPL(unexec,bfd,xgcl) Binary License: GPL due to GPL'ed components: (UNEXEC) Modifications of this banner must retain notice of a compatible license Dedicated to the memory of W. Schelter Use (help) to get some basic information on how to use GCL. Temporary directory for compiler files set to C:/DOCUME~1/bpage/LOCALS~1/Temp/ >(si:stat "tryserv.tcl") (:FILE 481 1158724649) >(si:stat "tryserv.xxx") NIL >(si:stat "bfd") (:DIRECTORY 0 1158734019) >(quit) ------------ The difference between this and your output below seems to be due to a change in the coding for this section in the current CVS which now looks like this: if (lstat(filename,&ss)) RETURN1(Cnil); else {/* ctime_r insufficiently portable */ /* int j; ctime_r(&ss.st_ctime,filename); j=strlen(filename); if (isspace(filename[j-1])) filename[j-1]=0;*/ RETURN1(list(3,S_ISDIR(ss.st_mode) ? sKdirectory : (S_ISLNK(ss.st_mode) ? sKlink : sKfile), make_fixnum(ss.st_size),make_fixnum(ss.st_ctime))); ------- So is this the result you expected from Windows? Regards, Bill Page. > > In addition to knowing whether enough information is provided, I need > to know if it works on windows, macosx, and any other proprietary > system of interest. > ... > > > > The easy way, which avoids the requirement of PDP-10 lisp > > comaptability :-), is si::stat. How about this: > > > > Index: unixfsys.c > > =================================================================== > > RCS file: /cvsroot/gcl/gcl/o/unixfsys.c,v > > retrieving revision 1.28 > > diff -u -r1.28 unixfsys.c > > --- unixfsys.c 24 Aug 2006 16:53:28 -0000 1.28 > > +++ unixfsys.c 12 Sep 2006 16:35:56 -0000 > > @@ -23,6 +23,7 @@ > > #include <stdlib.h> > > #include <unistd.h> > > #include <errno.h> > > +#include <time.h> > > > > #define IN_UNIXFSYS > > #include "include.h" > > @@ -490,6 +491,34 @@ > > } > > > > > > +DEF_ORDINARY("DIRECTORY",sKdirectory,KEYWORD,""); > > +DEF_ORDINARY("LINK",sKlink,KEYWORD,""); > > +DEF_ORDINARY("FILE",sKfile,KEYWORD,""); > > + > > > +DEFUN_NEW("STAT",object,fSstat,SI,1,1,NONE,OO,OO,OO,OO,(objec > t path),"") { > > + > > + char filename[4096]; > > + struct stat ss; > > + > > + > > + bzero(filename,sizeof(filename)); > > + coerce_to_filename(path,filename); > > + if (lstat(filename,&ss)) > > + RETURN1(Cnil); > > + else { > > + int j; > > + ctime_r(&ss.st_ctime,filename); > > + j=strlen(filename); > > + if (isspace(filename[j-1])) > > + filename[j-1]=0; > > + RETURN1(list(3,S_ISDIR(ss.st_mode) ? sKdirectory : > > + (S_ISLNK(ss.st_mode) ? sKlink : sKfile), > > + make_fixnum(ss.st_size),make_simple_string(filename))); > > + } > > +} > > + > > + > > + > > > DEFUN_NEW("SETENV",object,fSsetenv,SI,2,2,NONE,OO,OO,OO,OO,(ob > ject variable,object value),"Set environment VARIABLE to VALUE") > > > > { > > > > > > >(si::stat "/tmp/ff1.h") > > > > (:LINK 9 "Tue Sep 12 12:32:58 2006") > > > > >(si::stat "/tmp/ff.h") > > > > (:FILE 0 "Mon Dec 5 13:52:23 2005") > > > > >(si::stat "/tmp/") > > > > (:DIRECTORY 81920 "Tue Sep 12 12:34:53 2006") > > > > >(si::stat "/tmp") > > > > (:DIRECTORY 81920 "Tue Sep 12 12:34:53 2006") > > > > >(si::stat "/tmp1") > > > > NIL > > ... _______________________________________________ Axiom-developer mailing list Axiom-developer@nongnu.org http://lists.nongnu.org/mailman/listinfo/axiom-developer