From: Lam
Subject: pb with proble-file and dot file
Date: 
Message-ID: <tc1y918y2u.fsf@lam.dev33.cvf>
hello

i have this problem :

[1]>  (probe-file "/home/lam/.clisprc")

*** - no file name given: #P"/home/lam/.clisprc"

how can i do to test if it is a file ? 
thanks

-- 
Lam

Le cur� est devenu fou entre deux messes

From: Tim Bradshaw
Subject: Re: pb with proble-file and dot file
Date: 
Message-ID: <ey3fzxh7hwy.fsf@cley.com>
* lam-no-spamm-thanks  wrote:
> [1]>  (probe-file "/home/lam/.clisprc")

> *** - no file name given: #P"/home/lam/.clisprc"

> how can i do to test if it is a file ? 
> thanks

I think this is somewhat unfortunate behaviour - I think that somehow
it should work in the presence of Unixoid dot files since they are so
pervasive.  There are many border cases with pathnames that I don't
really understand...

But you can make it work like this:

(probe-file
 (make-pathname :name ".clisprc" :defaults #P"~/"))

Note this pathname will print the same way #P"~/.clisprc" does, but
it's secretly different...

--tim
From: Pierre R. Mai
Subject: Re: pb with proble-file and dot file
Date: 
Message-ID: <m2wuqtipmt.fsf@ibook.bln.pmsf.net>
Lam <···················@nospam.org> writes:

> hello
>
> i have this problem :
>
> [1]>  (probe-file "/home/lam/.clisprc")
>
> *** - no file name given: #P"/home/lam/.clisprc"
>
> how can i do to test if it is a file ? 

This is the result of CLISPs interpretation rules for namestrings,
which parse "/home/lam/.clisprc" as a pathname with type .clisprc, and
no name.  You would have to look at the documentation of clisp to find
out what exact rules they use (if this is documented), and if there is
a way to specify a namestring that is parsed as you would like.

In any case the following should work:

(probe-file (make-pathname :name ".clisprc" 
                           :directory '(:absolute "home" "lam")))

Regs, Pierre.

-- 
Pierre R. Mai <····@acm.org>                    http://www.pmsf.de/pmai/
 The most likely way for the world to be destroyed, most experts agree,
 is by accident. That's where we come in; we're computer professionals.
 We cause accidents.                           -- Nathaniel Borenstein
From: Adam Warner
Subject: Re: pb with proble-file and dot file
Date: 
Message-ID: <ajdkr8$19eoom$1@ID-105510.news.dfncis.de>
Hi Lam,

> hello
> 
> i have this problem :
> 
> [1]>  (probe-file "/home/lam/.clisprc")
> 
> *** - no file name given: #P"/home/lam/.clisprc"
> 
> how can i do to test if it is a file ? thanks

(if (directory "/home/lam/.clisprc") "file exists")
[assuming .clisprc is a file as specified]

I've found directory gives me all the information I need to locate files
and directories in CLISP.

Use (directory "*") to get a list of the files in the current directory.

Use (directory "*/") to get a list of the subdirectories in the current
directory.

Use ext:cd [or just cd] to change directories (it's a built in CLISP
extension).

If you suspect a file might turn out to be a directory remember to catch
the error that results if the match "names a directory, not a file". If
you are searching for a directory just append a forward slash:

(directory "/home/lam/.directory/")
(#P"/home/lam/.directory/")

Regards,
Adam