max-mapper / max-mapper/extract-zip

Cannot overwrite existing directory if symlink present (OSX)

Open
#20 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
398
Forks
144
PR merge metrics
No merged PRs in 30d

Description

Let's say I have x.zip with contains a symlink and I unzip the first time to /foo.
If I try to unzip the same zip (or another zip containing the same symlink) to /foo it will fail with EEXIST. Regular files overwrite as expected (ie fs.writestream by default will overwrite). Unfortunately fs.symlink fails if the symlink already exists.

I can make a PR but do you have any suggestions on how to proceed?
I was thinking we check if the symlink already exists and delete before creating the new symlink.

Furthermore - should overwrite be set by flag (for the regular files as well)?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the extraction path that calls fs.symlink and compare it with the fs.writestream overwrite behavior described in the issue. Clarify whether existing symlinks should be replaced and whether overwrite belongs behind a flag; done means repeated extraction no longer fails with EEXIST and the chosen behavior is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.