On Sun, 26 Oct 2008, Peter Bex wrote:
On Sun, Oct 26, 2008 at 01:19:42AM -0700, Elf wrote:
~$ touch abc\\298.test
csi> (find-files "." regular-file? (lambda (x y)(print x)
(print (file-stat (canonical-path x)))))
./abc\298.test
Error: (file-stat) cannot access file - No such file or
directory: "/home/matt/stuff/tools/lmbk/abc/298.test"
this isn't a bug; it has to handle both windows and unix paths. i can add
optional flags for specifying behaviour of slash and backslash, if desired.
It would be better to make the behaviour be system-specific, instead of
adding flags. On Windows, *always* treat slashes as backslashes. On Unix,
*only* accept slashes with no additional translation steps. (I'm not sure
Windows doesn't allow slashes in filenames, but I don't think it does)
the idea was to allow for system-independent handling of pathnames with
proper resolution. since the system for which a given path string was written
is not knowable, it properly converts any relative (or absolute) path into
the proper form for the local architecture.
Also, why does file-stat interpret the backslash in the first place?
AFAIK you can mix slashes and backslashes in Windows, so you shouldn't
have to do anything at all.
file-stat doesnt interpret the backslash, its canonical-path which does.
-elf
_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users