Page 1 of 1

About function "directory?"

Posted: Thu Mar 24, 2005 8:12 am
by alex
Why (directory? "c:\\winnt") => true
but (directory? "c:") => nil

and why (directory? "c:\\") => true
but (directory? "c:\\winnt\\") => nil

It is right?
May be "\\" at the end of directory must be ignored?

Posted: Thu Mar 24, 2005 1:50 pm
by Lutz
This is how the underlying 'C' library function opendir() processes the directory string on Windows. On Linux/UNIX a trailing slash is accepted. I opted of reflecting the OS's berhaviour on this, thinking it might be more consistent with the behaviour of other parts in the system.

I mean there must be a reason that everybody including the GCC people implement opendir() on the Windows platform this way. This would be a one line change in the newLISP source but I would like to hear the opinion of a group of people, specially those more familiar with Win32 internals.

Lutz