About function "directory?"

Started by alex, March 24, 2005, 12:12:55 AM

Previous topic - Next topic

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?

Lutz

#1
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