Skip to content

request: add option to call fsync() when closing files #49886

Closed
@cjihrig

Description

@cjihrig

What is the problem this feature will solve?

I believe it is possible that Node can close a file and then try to interact with the same file before all of the data has been written to disk. According to the docs for close(2) this can be fixed by calling fsync().

What is the feature you are proposing to solve the problem?

Add an option to the appropriate fs functions (close(), writeFile(), etc.) to call fsync() automatically.

What alternatives have you considered?

Flushing the data "by hand."

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.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