Skip to content

Copying a Link from One File to Another Link to the Same File errors out in isSrcSubdir #1019

@cowsandmilk

Description

@cowsandmilk
  • Operating System: MacOS, Linux
  • Node.js version: 20.8.0, 18
  • fs-extra version: 11.1.1

Set up

touch testFile
ln -s testFile testLink1
ln -s testFile testLink2

Then, in node:

fs.copy('testLink1', 'testLink2');
Uncaught Error: Cannot copy 'testFile' to a subdirectory of itself, 'testFile'.

There are no directories involved here. The call to copyLink would succeed perfectly fine and do the correct thing in this case.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions