|
From: | Kon Lovett |
Subject: | Re: [Chicken-users] file-exists? on Windows |
Date: | Mon, 14 May 2007 11:46:36 -0700 |
On May 14, 2007, at 11:28 AM, John Cowan wrote:
Mario Domenech Goulart scripsit:Isn't (file-exists? ".\\") supposed to return ".\\" on windows?Ah. No. The Win32 kernel does *not* ignore trailing backslashes the way the Unix kernel ignores trailing slashes -- instead, it returns file-not-found errors.
This comes down to a question of platform abstraction. Which I suspect is the unspoken point of Mario's. We do need to remember that whatever their compatibility layers/modes Win32 & MacOS X are not unix. But Chicken does seem to have a bent for providing a common filesystem view so '(file-exists? ".\\")' probably should work on Windows, with a little help from special case handling.
Note also that the root directory of a Win32 volume does not contain"." or ".." files (Cygwin fakes them), so it is not even fully reliableto ask if "." exists.
Since I use MinGW I think I link w/ the system dlls so the '_stat' implementation is native. I does appear to handle "." & ".." pathnames "correctly", given your point about the trailing directory separator above.
-- By Elbereth and Luthien the Fair, you shall address@hiddenhave neither the Ring nor me! --Frodo http://www.ccil.org/ ~cowan_______________________________________________ Chicken-users mailing list address@hidden http://lists.nongnu.org/mailman/listinfo/chicken-users
[Prev in Thread] | Current Thread | [Next in Thread] |