Skip to content

Windows: copy_tree and list_files_text follow junctions and directory symlinks #1952

Closed

Description

@ehartford

Noted in #1863's description and confirmed in review: after #1863, remove_tree on Windows treats a junction/symlink as the link itself, but copy_tree and list_files_text still descend into the target. The POSIX copy_tree is lstat-based and does not follow. Make the Windows walkers classify entries with the same win_is_link test (reparse point + name-surrogate bit) and copy/list the link, not its target, with a test mirroring behav_fs_remove_tree_windows_junctions.w.

Activity

  1. added
    bug
    on Oct 2, 2026
  2. ehartford commented on Oct 3, 2026

    @ehartford
    ContributorAuthor

    Fixed on main by 3044b9c (stack #1979, battery green on 029574d). Windows copy_tree and list_files_text classify entries with win_is_link; a link lists as itself and copy_tree refuses a directory link (-21), matching macOS; verified on win10.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions