Page 1 of 1

A suggestion

Posted: Mon Sep 28, 2009 12:38 pm
by linli
I just noticed that when I do (directory? "c:\"), I got nil. Should it return true instead? The drive can be considered as the "root" directory on that drive.

Posted: Mon Sep 28, 2009 12:46 pm
by HPW
How about:

Code: Select all

> (directory? "C:\\.")
true
> (directory? "C:\.")
true
> (directory? "C:.")
true

Posted: Mon Sep 28, 2009 12:49 pm
by newdep
what newlisp version are you using ?

because I get true out of this ->

>(directory? {c:\})
true

the "c:\" gives an error..

Posted: Mon Sep 28, 2009 1:44 pm
by linli
I am using 10.1.5.
(directory? "c:\\") => nil
(directory? "c:\\\\") =>true

Posted: Mon Sep 28, 2009 2:50 pm
by newBert
For me on Win XP with NewLISP 10.1.5 :
newLISP v.10.1.5 on Win32 IPv4, execute 'newlisp -h' for more info.

> (directory? "c:\")

ERR: string token too long : "c:\")\r\n"
> (directory? "c:\\")
nil
> (directory? {c:\})
nil
> (directory? {c:\\})
true
>
and :
> (directory? "c:/")
nil
> (directory? "\")

ERR: string token too long : "\")\r\n"
> (directory? "\\")
nil
> (directory? "\\.")
true
> (directory? "/.")
true
>