A suggestion

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
linli
Posts: 8
Joined: Tue Sep 01, 2009 3:13 pm

A suggestion

Post 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.

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

How about:

Code: Select all

> (directory? "C:\\.")
true
> (directory? "C:\.")
true
> (directory? "C:.")
true
Hans-Peter

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

what newlisp version are you using ?

because I get true out of this ->

>(directory? {c:\})
true

the "c:\" gives an error..
-- (define? (Cornflakes))

linli
Posts: 8
Joined: Tue Sep 01, 2009 3:13 pm

Post by linli »

I am using 10.1.5.
(directory? "c:\\") => nil
(directory? "c:\\\\") =>true

newBert
Posts: 156
Joined: Fri Oct 28, 2005 5:33 pm
Location: France

Post 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
>
BertrandnewLISP v.10.7.6 64-bit on Linux (Linux Mint 20.1)

Locked