[Ecls-list] Determining if a pathname refers to a directory
Juan Jose Garcia-Ripoll
juanjose.garciaripoll at googlemail.com
Sat Feb 26 19:49:20 UTC 2011
On Sat, Feb 26, 2011 at 8:33 PM, Zach Beane <xach at xach.com> wrote:
> Juan Jose Garcia-Ripoll <juanjose.garciaripoll at googlemail.com> writes:
>
> > $ ls -l |grep tmp
> > drwxr-xr-x 20 jjgarcia jjgarcia 680 Feb 20 23:59 tmp
> > $ ln -sf tmp foo
> > $ ecl -norc -eval '(print (truename "foo"))' -eval '(quit)'
> >
> > #P"/Users/jjgarcia/tmp/"
> >
> > I would rather use this method. It is more portable and FILE-KIND may or
> may
> > not exist in the future!
>
> You mean testing to see that the pathname returned by TRUENAME has no
> name or type?
Exactly. I believe this was your original problem: you got a path without
the proper format (no trailing slash) and your code did not know whether it
was a directory or not.
Juanjo
--
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20110226/e4e079d9/attachment.html>
More information about the ecl-devel
mailing list