About function "directory?"

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
alex
Posts: 100
Joined: Thu Mar 10, 2005 2:27 pm
Location: Russia

About function "directory?"

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

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post 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

Locked