Skip to content

copyFileSync expected behavior? #15770

Closed
Closed
@favio41

Description

@favio41
  • Version:8.6.0
  • Platform: 16.04.1-Ubuntu
  • Subsystem:fs

I'm getting what I think is an unexpected behavior when I use this function

const fs = require('fs');
fs.copyFileSync('numeric.log', 'alpha.log');

using this files:
numeric.log:

1
2
3

alpha.log

a
b
c
d
e

I'm expecting a full rewrite of my destination file, but instead, I get:
alpha.log

1
2
3
d
e

Is this the intended behavior? If yes I recommend this should be disclosed on the docs.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    fsIssues and PRs related to the fs subsystem / file system.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions