gcl-devel
[Top][All Lists]
Advanced

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

[Gcl-devel] Re: probe-file on directories


From: Camm Maguire
Subject: [Gcl-devel] Re: probe-file on directories
Date: 23 Jan 2007 17:43:30 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings!

Yes, this has been an ansi change pushed into 2.6 to accomodate axiom,
mainly.   The spec at least appears to indicate that this function
should be specific to files, though I think Paul has decided that it
is vague enough not to force an error in his test suite.  In any case,
there appears to be no standard function (barring this reading) which
enables one to distinguish a file from a directory.  How then might
one write, for example, a little web server on a socket which will
copy files across, but not attempt to open directories?  It was
decided to therefore use probe-file to indicate a true file, and
the output of 'directory and the various pathname functions to
indicate directories.  clisp does similar, if memory serves.

truename won't work if you need to avoid error on missing pathnames,
but will otherwise.

In general, it was felt at the time that the spec was unsatisfactory
on this point, so we have also supplied a gcl specific function,
(si::stat ...), which distinguishes files from directories, gives the
size, and the inode, at present.

Please let me know if any of this is a problem for you.

Take care,

Matt Kaufmann <address@hidden> writes:

> Hi --
> 
> I've always been able to use probe-file to see if a directory exists,
> but that doesn't seem to be working on a 64-bit linux machine, in GCL
> 2.6.7 CLtL1 or (a version of) 2.7.0 ANSI.  Any suggestions?  The
> following log shows that probe-file is returning nil for a directory
> that clearly exists.
> 
>   lhug-1:/projects/acl2/devel> ~boyer/bin-override/5
>   GCL (GNU Common Lisp)  2.7.0 ANSI    Dec  5 2006 20:38:58
>   Source License: LGPL(gcl,gmp,pargcl), GPL(unexec,bfd,xgcl)
>   Binary License:  GPL due to GPL'ed components: (XGCL READLINE BFD 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 /tmp/
> 
>   >(probe-file "/projects/acl2/devel/books/")
> 
>   NIL
> 
>   >(probe-file "/projects/acl2/devel/books")
> 
>   NIL
> 
>   >(probe-file "/projects/acl2/devel/books/certify-numbers.lisp")
> 
>   #P"/v/filer3/v0q004/acl2/devel/books/certify-numbers.lisp"
> 
>   >
> 
> Thanks --
> -- Matt
> 
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

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