3

这似乎可能是 ECL 实现中的一个错误——或者由于标准中的一些细节:

    > (probe-file #P"/usr")

    #P"/usr/"
    > (probe-file #P"/usr/")

    #P"/usr/"
    > (probe-file #P"/")

    NIL
    > (probe-file #P"//")

    NIL

还有一个案例:

    > (probe-file #P"/.")

    #P"/"

更新,FWIW,SBCL 符合我的期望:

    * (probe-file #P"/")

    #P"/"
4

1 回答 1

1

这是我现在正在测试的修复的提交消息(希望这能回答问题——这确实是一个错误):

unixfsys:删除 coerce_to_posix_filename

当目录名称以“/”结尾时,这是一种解决 cygwin 和 mingw(已修复)中的错误的解决方法。此修复引入了在根目录上调用的探针文件的额外错误(它在所有平台上都返回 nil)。

原评论:

这会将路径名指示符转换为名称字符串,特别是目录不以斜杠“/”结尾,因为并非所有 POSIX 平台(尤其是 Windows)都支持这一点。

错误参考:

https://sourceforge.net/p/mingw-w64/patches/34/

修复 #351。

于 2017-02-04T11:39:40.123 回答