Skip to content

Node fs.copyfileSync hangs when source and destination are identicalΒ #27746

@fgauthie

Description

@fgauthie

Unless the fs.constants.COPYFILE_EXCL flag is passed, when source and destination are the same, Node hangs forever.

const fs = require('fs'); 

fs.writeFileSync('foo', 'Hello World!');
fs.copyFileSync('foo', 'foo');

//Never reach here
console.log('Done');

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.libuvIssues and PRs related to the libuv dependency or the uv binding.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions