Skip to content

openSync/writeSync/closeSync produces empty file #7879

@gracjan

Description

@gracjan

Code:

var fd = fs.openSync("abc.txt", "w");
var buf = Buffer.from("Was here.\n");
fs.writeSync(fd, buf);
fs.closeSync(fd);

produces empty file. Expected is that it writes whole buffer. Note that fs.writeSync(fd, "Was here.\n"); writes whole string.

  • Version:
    v6.2.2
  • Platform:
    Darwin MacBook-Pro-3.local 14.5.0 Darwin Kernel Version 14.5.0: Thu Apr 21 20:40:54 PDT 2016; root:xnu-2782.50.3~1/RELEASE_X86_64 x86_64
  • Subsystem:
    fs(?)

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