[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] file-exists? on Windows
From: |
John Cowan |
Subject: |
Re: [Chicken-users] file-exists? on Windows |
Date: |
Mon, 14 May 2007 15:53:28 -0400 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Kon Lovett scripsit:
> 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.
I think a lot of help is required to get this right. You can strip
trailing backslashes and slashes (Win32 will accept either as a
path delimiter), but faking . and .. in volume roots is not simple.
In particular, "J:\\" might not be a root if it's a mount point
(Windows does have those), and "\\\\foo\\c$" is the root directory
of C: on the local network system named "foo"; the name conventionally
ends in "$" but need not.
IMHO it is not worth working so hard to get this corner case correct;
you will end up reimplementing half of Cygwin.
> 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.
Are you sure? "." and ".." really do exist in directories that aren't
volume roots. Try accessing "C:\\.".
--
John Cowan address@hidden http://www.ccil.org/~cowan
Most languages are dramatically underdescribed, and at least one is
dramatically overdescribed. Still other languages are simultaneously
overdescribed and underdescribed. Welsh pertains to the third category.
--Alan King
- Re: [Chicken-users] file-exists? on Windows, (continued)
- Re: [Chicken-users] file-exists? on Windows, Mario Domenech Goulart, 2007/05/14
- Re: [Chicken-users] file-exists? on Windows, Kon Lovett, 2007/05/14
- Re: [Chicken-users] file-exists? on Windows, John Cowan, 2007/05/14
- Re: [Chicken-users] file-exists? on Windows, Kon Lovett, 2007/05/14
- Re: [Chicken-users] file-exists? on Windows, Graham Fawcett, 2007/05/14
- Re: [Chicken-users] file-exists? on Windows, Mario Domenech Goulart, 2007/05/14
- Re: [Chicken-users] file-exists? on Windows, Graham Fawcett, 2007/05/14
- [Chicken-users] Chicken Testing (Was: file-exists? on Windows), Kon Lovett, 2007/05/14
- Re: [Chicken-users] Chicken Testing (Was: file-exists? on Windows), felix winkelmann, 2007/05/15
- Re: [Chicken-users] Chicken Testing (Was: file-exists? on Windows), Kon Lovett, 2007/05/15
- Re: [Chicken-users] file-exists? on Windows,
John Cowan <=
- Re: [Chicken-users] file-exists? on Windows, Alex Queiroz, 2007/05/14
- Re: [Chicken-users] file-exists? on Windows, Kon Lovett, 2007/05/14
- Re: [Chicken-users] file-exists? on Windows, Alex Queiroz, 2007/05/14
- Re: [Chicken-users] file-exists? on Windows, Mario Domenech Goulart, 2007/05/14
- Message not available
- Re: [Chicken-users] file-exists? on Windows, Kon Lovett, 2007/05/14
- Re: [Chicken-users] file-exists? on Windows, felix winkelmann, 2007/05/15
- Re: [Chicken-users] file-exists? on Windows, Thomas Christian Chust, 2007/05/15
- [Chicken-users] MacOS X is its' own beast, Kon Lovett, 2007/05/15
- [Chicken-users] Re: MacOS X is its' own beast, Thomas Christian Chust, 2007/05/16
- Re: [Chicken-users] Re: MacOS X is its' own beast, Raffael Cavallaro, 2007/05/16