gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gcl-devel] Re: Axiom on Windows


From: Michael Koehne
Subject: Re: [Gcl-devel] Re: Axiom on Windows
Date: Wed, 16 Jun 2004 19:10:30 +0200
User-agent: Mutt/1.3.28i

Moin Mike Thomas,

> (probe-file "./") on Windows GCL *(CLtL1) gives nil which is, I think,
> invalid.  LispWorks gives the current working directory which I believe
> would be the correct result - or perhaps "./"?

  >(probe-file "./")
  #P"/bakunin/home/kraehe/"             ; on Unix
  #P"C:/Documents and Settings/miketh/" ; should be on windows

  >(namestring nil)
     NIL is not of type PATHNAME.        ; NIL does not mean "NIL" !

> Likewise, (namestring nil) returns the string "nil" which I also think is
> invalid - LispWorks raises an error which, again, I think would be the
> correct response.

  (namestring nil) -> "NIL" had been without my patch, iirc

  >(namestring (probe-file "./"))
  "/bakunin/home/kraehe/"

  what happens to those functions, if you apply the pathname patch from
  www.copyleft.de/lisp/ ?
  
  Probefile might still not work - we need some #ifdef in o/unixfsys.c,
  if this is the case for file_exists - try :

#define MAXPATHLEN 4096
#include <sys/stat.h>
main()
{   struct stat filestatus;
    char current_directory[MAXPATHLEN];
    char *p;
    getwd(current_directory);
    printf("getwd %s\n",current_directory);
    if (stat("C:/Documents and Settings/miketh/", &filestatus) < 0)
                printf("stat failed for miketh !\n");
    for (p=current_directory; (p-current_directory<4069) && *p; p++)
        if (*p=='\\') *p=='/';
    printf("what about getwd %s\n",current_directory);
    if (stat(current_directory, &filestatus) < 0)
                printf("stat failed for cwd ?\n");
    if (p==current_directory)
        { *p='/'; p[1]=0; }
    else
    if (p[-1]!='/')
        { *p='/'; p[1]=0; }
    printf("what about getwd %s\n",current_directory);
    if (stat(current_directory, &filestatus) < 0)
                printf("stat failed for cwd ?\n");
}

  probe_file calls truename after checking file_exists, and there you might
  need to map the \\ windows directory seperators into / unix directory,
  before truename calls coerce_to_pathname.

Bye Michael
-- 
  mailto:address@hidden             UNA:+.? 'CED+2+:::Linux:2.4.22'UNZ+1'
  http://www.xml-edifact.org/           CETERUM CENSEO WINDOWS ESSE DELENDAM




reply via email to

[Prev in Thread] Current Thread [Next in Thread]