Skip to content

Zipping a folder with symlinks causes ENAMETOOLONG #541

Closed

Description

@iurii-iufimov-forgood

I'm trying to run addLocalFolder on a folder which contains recursive symbolic links

I have a JS project, that utilises yarn workspaces and has a following structure:

root
|-> worskpace-a
    |-> node_modules
        |-> worskpace-a (symlink to higher folder)

Trying to run addLocalFolder on such folder results in ENAMETOOLONG error and that's totally understandable.

What I believe is an issue, is that fact, that filter function doesn't prevent this: all reachable files are collected before filter is used:
https://github.com/cthackers/adm-zip/blob/master/adm-zip.js#L389

Maybe addLocalFolder should support some filter for parsed folders, not only files...

Activity

  1. cthackers commented on Jul 10, 2026

    @cthackers
    Owner

    fixed

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions