Skip to content

[ls] -L 无法解引用符号链接:文件/目录链接均报 cannot access,rc=2 #1640

Closed

Description

@caomengxuan666

现象

ls -L 对符号链接条目报 cannot access './link': No such file or directory,目录链接同样失败,整体 rc=2;GNU 解引用后按目标类型输出。

  • WinuxCmd:WinuxCmd 1.2.1(基线 b781ff3,Release 构建)

  • GNU oracle:coreutils 9.4(WSL2),LC_ALL=C、TZ=UTC

  • 契约锚点:DOCS/oracle-audit/ls.md 行 L19

复现

$d = "$env:TEMP\ls-L"; Remove-Item -Recurse -Force $d -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Force -Path "$d" | Out-Null
Set-Content -Path "$d\a.txt" -Value "aaa"; cmd /c mklink "$d\link" "$d\a.txt"
& "...\ls.exe" -lL link a.txt ; "rc=$LASTEXITCODE"

GNU 9.4(expected):

-rw-r--r-- 2 root root 4 Jan  2  2020 a.txt
-rw-r--r-- 2 root root 4 Jan  2  2020 link
rc=0

WinuxCmd 1.2.1(actual):

-rwxrwxrwx 2 cmx None 4 Jan  2  2020 a.txt
ls: cannot access 'link': No such file or directory
rc=2

影响

ls -L 在含符号链接的目录上不可用,-RL 等组合直接失败。

Activity

  1. added
    compat-gap
    on Nov 14, 2026
  2. caomengxuan666 commented on Nov 14, 2026

    @caomengxuan666
    MemberAuthor

    intake 定序:ls 面同文件串行——本单待 #1639 合入后派修(队长队列,先派 #1639)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

compat-gap

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions