[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Bug in canonical-path?

From: Elf
Subject: Re: [Chicken-users] Bug in canonical-path?
Date: Tue, 28 Oct 2008 03:08:57 -0700 (PDT)

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)))))

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]