chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] pathname-normalize


From: Thomas Chust
Subject: Re: [Chicken-users] pathname-normalize
Date: Mon, 1 May 2006 18:20:02 +0000 (GMT)

On Mon, 1 May 2006, Reed Sheridan wrote:

[...] Also, the implementation of absolute-path? has a bug. It returns #t for a pathname starting with windows-style drive letters, but in Unix, A:/foo is a perfectly valid relative pathname. I'm not sure how to conditionalize Chicken code for Windows, or I'd fix this. [...]

Hello,

conditionalizing the code is possible using checks on the return values of (software-type) and (build-platform). Something like this should work:

   (define-macro windows-or-unix
     (case (software-type)
       ((windows)
        (project 0))
       ((unix)
        (project 1))))

Generally I wonder, though, why the pathname procedures aren't implemented in C. Especially on POSIX platforms where functions like realpath are part of the standard C library this would probably be more efficient.

cu,
Thomas




reply via email to

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