GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fs: add flush option to writeFile() functions by cjihrig · Pull Request #50009 · nodejs/node

Conversation

@cjihrig

@cjihrig cjihrig commented Oct 2, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This commit adds a 'flush' option to the fs.writeFile family of functions.

Refs: #49886

Notable change summary: When writing to files, it is possible that data is not immediately flushed to permanent storage. This allows subsequent read operations to see stale data. This PR adds a 'flush' option to the fs.writeFile family of functions which forces the data to be flushed at the end of a successful write operation.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss and OverflowCat reacted with rocket emoji
All reactions
  • 🚀 2 reactions
@nodejs-github-bot nodejs-github-bot added fs Issues and PRs related to file-system APIs and the fs module. needs-ci PRs that need a full CI run. labels Oct 2, 2023
@cjihrig
fs: add flush option to writeFile() functions
ad3a583
This commit adds a 'flush' option to the fs.writeFile family of
functions.

Refs: nodejs#49886
@cjihrig
cjihrig force-pushed the auto-sync branch from 9712839 to ad3a583 Compare October 2, 2023 03:58
mcollina
mcollina approved these changes Oct 2, 2023
View reviewed changes

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
targos
targos approved these changes Oct 2, 2023
View reviewed changes
@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 2, 2023
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 2, 2023
@nodejs-github-bot

nodejs-github-bot commented Oct 2, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/54456/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

LiviaMedeiros
LiviaMedeiros approved these changes Oct 2, 2023
View reviewed changes
@github-actions github-actions Bot mentioned this pull request Oct 3, 2023
CI Reliability 2023-10-03 nodejs/reliability#682
Open
18 tasks
@cjihrig
run make format-md
78ab583
@nodejs-github-bot

nodejs-github-bot commented Oct 3, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/54482/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

watilde
watilde approved these changes Oct 3, 2023
View reviewed changes
@nodejs-github-bot

nodejs-github-bot commented Oct 3, 2023 •
edited by cjihrig
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/54483/ 🟢

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cjihrig cjihrig added author ready PRs with CI started, the required approvals, and no outstanding review comments. and removed needs-ci PRs that need a full CI run. labels Oct 3, 2023
mcollina
mcollina approved these changes Oct 3, 2023
View reviewed changes

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@anonrig anonrig added the needs-ci PRs that need a full CI run. label Oct 3, 2023
@github-actions github-actions Bot mentioned this pull request Oct 4, 2023
CI Reliability 2023-10-04 nodejs/reliability#683
Open
14 tasks
@mcollina mcollina added the notable-change PRs with changes that should be highlighted in changelogs. label Oct 4, 2023
@github-actions

github-actions Bot commented Oct 4, 2023

Copy link
Copy Markdown
Contributor

The notable-change PRs with changes that should be highlighted in changelogs. label has been added by @mcollina.

Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cjihrig cjihrig added commit-queue PRs queued for automated landing through the Commit Queue. commit-queue-squash PRs the Commit Queue should land as one squashed commit. and removed needs-ci PRs that need a full CI run. labels Oct 4, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Oct 4, 2023
@nodejs-github-bot
nodejs-github-bot merged commit e01c1d7 into nodejs:main Oct 4, 2023
@nodejs-github-bot

nodejs-github-bot commented Oct 4, 2023

Copy link
Copy Markdown
Collaborator

Landed in e01c1d7

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cjihrig
cjihrig deleted the auto-sync branch October 4, 2023 13:10
@github-actions github-actions Bot mentioned this pull request Oct 5, 2023
CI Reliability 2023-10-05 nodejs/reliability#684
Open
13 tasks
@targos targos mentioned this pull request Nov 12, 2023
v20.10.0 release proposal #50682
Merged
targos added a commit that referenced this pull request Nov 12, 2023
@targos
2023-11-16, Version 20.10.0 'Iron' (LTS)
63ca6db
Notable changes:

deps:
  * (SEMVER-MINOR) update uvwasi to 0.0.19 (Node.js GitHub Bot) #49908
doc:
  * add H4ad to collaborators (Vinícius Lourenço) #50217
esm:
  * (SEMVER-MINOR) detect ESM syntax in ambiguous JavaScript (Geoffrey Booth) #50096
  * use import attributes instead of import assertions (Antoine du Hamel) #50140
  * --experimental-default-type flag to flip module defaults (Geoffrey Booth) #49869
fs:
  * (SEMVER-MINOR) add flush option to appendFile() functions (Colin Ihrig) #50095
  * add flush option to writeFile() functions (Colin Ihrig) #50009
lib:
  * (SEMVER-MINOR) add WebSocket client (Matthew Aitken) #49830
stream:
  * (SEMVER-MINOR) allow pass stream class to `stream.compose` (Alex Yang) #50187
  * call helper function from push and unshift (Raz Luvaton) #50173
  * optimize Writable (Robert Nagy) #50012
test_runner, cli:
  * (SEMVER-MINOR) add --test-concurrency flag (Colin Ihrig) #49996
vm:
  * (SEMVER-MINOR) use import attributes instead of import assertions (Antoine du Hamel) #50141
  * use default HDO when importModuleDynamically is not set (Joyee Cheung) #49950
wasi:

PR-URL: #50682
RyanZim added a commit to RyanZim/node that referenced this pull request Nov 16, 2023
@RyanZim
doc: fix fs.writeFileSync return value documentation
81c4301
In nodejs#50009, the return value was accidentally made part of `flush` option bullet point.
@RyanZim RyanZim mentioned this pull request Nov 16, 2023
doc: fix fs.writeFileSync return value documentation #50760
Merged
nodejs-github-bot pushed a commit that referenced this pull request Nov 18, 2023
@RyanZim
doc: fix fs.writeFileSync return value documentation
724a233
In #50009, the return value was accidentally made part of `flush` option bullet point.

PR-URL: #50760
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
Reviewed-By: Deokjin Kim <[email protected]>
targos added a commit that referenced this pull request Nov 21, 2023
@targos
2023-11-22, Version 20.10.0 'Iron' (LTS)
a220664
Notable changes:

deps:
  * (SEMVER-MINOR) update uvwasi to 0.0.19 (Node.js GitHub Bot) #49908
doc:
  * add H4ad to collaborators (Vinícius Lourenço) #50217
esm:
  * (SEMVER-MINOR) detect ESM syntax in ambiguous JavaScript (Geoffrey Booth) #50096
  * use import attributes instead of import assertions (Antoine du Hamel) #50140
  * --experimental-default-type flag to flip module defaults (Geoffrey Booth) #49869
fs:
  * (SEMVER-MINOR) add flush option to appendFile() functions (Colin Ihrig) #50095
  * add flush option to writeFile() functions (Colin Ihrig) #50009
lib:
  * (SEMVER-MINOR) add WebSocket client (Matthew Aitken) #49830
stream:
  * (SEMVER-MINOR) allow pass stream class to `stream.compose` (Alex Yang) #50187
  * call helper function from push and unshift (Raz Luvaton) #50173
  * optimize Writable (Robert Nagy) #50012
test_runner, cli:
  * (SEMVER-MINOR) add --test-concurrency flag (Colin Ihrig) #49996
vm:
  * (SEMVER-MINOR) use import attributes instead of import assertions (Antoine du Hamel) #50141
  * use default HDO when importModuleDynamically is not set (Joyee Cheung) #49950
wasi:

PR-URL: #50682
targos added a commit that referenced this pull request Nov 22, 2023
@targos
2023-11-22, Version 20.10.0 'Iron' (LTS)
a9bd735
Notable changes:

deps:
  * (SEMVER-MINOR) update uvwasi to 0.0.19 (Node.js GitHub Bot) #49908
doc:
  * add H4ad to collaborators (Vinícius Lourenço) #50217
esm:
  * (SEMVER-MINOR) detect ESM syntax in ambiguous JavaScript (Geoffrey Booth) #50096
  * use import attributes instead of import assertions (Antoine du Hamel) #50140
  * --experimental-default-type flag to flip module defaults (Geoffrey Booth) #49869
fs:
  * (SEMVER-MINOR) add flush option to appendFile() functions (Colin Ihrig) #50095
  * add flush option to writeFile() functions (Colin Ihrig) #50009
lib:
  * (SEMVER-MINOR) add WebSocket client (Matthew Aitken) #49830
stream:
  * (SEMVER-MINOR) allow pass stream class to `stream.compose` (Alex Yang) #50187
  * call helper function from push and unshift (Raz Luvaton) #50173
  * optimize Writable (Robert Nagy) #50012
test_runner, cli:
  * (SEMVER-MINOR) add --test-concurrency flag (Colin Ihrig) #49996
vm:
  * (SEMVER-MINOR) use import attributes instead of import assertions (Antoine du Hamel) #50141
  * use default HDO when importModuleDynamically is not set (Joyee Cheung) #49950
wasi:

PR-URL: #50682
targos pushed a commit that referenced this pull request Nov 23, 2023
@RyanZim @targos
doc: fix fs.writeFileSync return value documentation
d70454b
In #50009, the return value was accidentally made part of `flush` option bullet point.

PR-URL: #50760
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
Reviewed-By: Deokjin Kim <[email protected]>
lucshi pushed a commit to lucshi/node that referenced this pull request Nov 27, 2023
@RyanZim Lei Shi
doc: fix fs.writeFileSync return value documentation
e83baa6
In nodejs#50009, the return value was accidentally made part of `flush` option bullet point.

PR-URL: nodejs#50760
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
Reviewed-By: Deokjin Kim <[email protected]>
lucshi pushed a commit to lucshi/node that referenced this pull request Nov 27, 2023
@targos Lei Shi
2023-11-22, Version 20.10.0 'Iron' (LTS)
e36ce82
Notable changes:

deps:
  * (SEMVER-MINOR) update uvwasi to 0.0.19 (Node.js GitHub Bot) nodejs#49908
doc:
  * add H4ad to collaborators (Vinícius Lourenço) nodejs#50217
esm:
  * (SEMVER-MINOR) detect ESM syntax in ambiguous JavaScript (Geoffrey Booth) nodejs#50096
  * use import attributes instead of import assertions (Antoine du Hamel) nodejs#50140
  * --experimental-default-type flag to flip module defaults (Geoffrey Booth) nodejs#49869
fs:
  * (SEMVER-MINOR) add flush option to appendFile() functions (Colin Ihrig) nodejs#50095
  * add flush option to writeFile() functions (Colin Ihrig) nodejs#50009
lib:
  * (SEMVER-MINOR) add WebSocket client (Matthew Aitken) nodejs#49830
stream:
  * (SEMVER-MINOR) allow pass stream class to `stream.compose` (Alex Yang) nodejs#50187
  * call helper function from push and unshift (Raz Luvaton) nodejs#50173
  * optimize Writable (Robert Nagy) nodejs#50012
test_runner, cli:
  * (SEMVER-MINOR) add --test-concurrency flag (Colin Ihrig) nodejs#49996
vm:
  * (SEMVER-MINOR) use import attributes instead of import assertions (Antoine du Hamel) nodejs#50141
  * use default HDO when importModuleDynamically is not set (Joyee Cheung) nodejs#49950
wasi:

PR-URL: nodejs#50682
RafaelGSS pushed a commit that referenced this pull request Nov 29, 2023
@RyanZim @RafaelGSS
doc: fix fs.writeFileSync return value documentation
b4935dd
In #50009, the return value was accidentally made part of `flush` option bullet point.

PR-URL: #50760
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
Reviewed-By: Deokjin Kim <[email protected]>
@juanarbol juanarbol mentioned this pull request Dec 6, 2023
2023-12-06, N|Solid v5.0.1 Iron Release nodesource/nsolid#41
Merged
UlisesGascon pushed a commit that referenced this pull request Dec 11, 2023
@RyanZim @UlisesGascon
doc: fix fs.writeFileSync return value documentation
f89a5eb
In #50009, the return value was accidentally made part of `flush` option bullet point.

PR-URL: #50760
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
Reviewed-By: Deokjin Kim <[email protected]>
UlisesGascon pushed a commit that referenced this pull request Dec 19, 2023
@RyanZim @UlisesGascon
doc: fix fs.writeFileSync return value documentation
549d442
In #50009, the return value was accidentally made part of `flush` option bullet point.

PR-URL: #50760
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
Reviewed-By: Deokjin Kim <[email protected]>
@boenrobot boenrobot mentioned this pull request Dec 29, 2023
refactor: use flush option with writeFile mikro-orm/mikro-orm#5058
Merged
debadree25 pushed a commit to debadree25/node that referenced this pull request Apr 15, 2024
@cjihrig @debadree25
fs: add flush option to writeFile() functions
b665c95
This commit adds a 'flush' option to the fs.writeFile family of
functions.

Refs: nodejs#49886
PR-URL: nodejs#50009
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: LiviaMedeiros <[email protected]>
Reviewed-By: Daijiro Wachi <[email protected]>
hhjmmmmmmmm
hhjmmmmmmmm reviewed May 2, 2024
View reviewed changes
Comment thread lib/fs.js
@@ -2217,7 +2217,7 @@ function lutimesSync(path, atime, mtime) {
handleErrorFromBinding(ctx);

@hhjmmmmmmmm hhjmmmmmmmm May 2, 2024

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docker pull python

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@gibson042 gibson042 mentioned this pull request Sep 15, 2024
CI sometimes fails to read swingset config file Agoric/agoric-sdk#10092
Closed
@WULCAN WULCAN mentioned this pull request Mar 15, 2025
Writes are not flushed before subsequent read zetkin/lyra#162
Closed
@amerharb amerharb mentioned this pull request Mar 15, 2025
Undocumented use flush option in fs.writeFile() zetkin/lyra#163
Merged
@WULCAN WULCAN mentioned this pull request Mar 29, 2025
Implemented Containerization of the Lyra Webapp zetkin/lyra#157
Merged
This was referenced Nov 2, 2025
fs: flush option ignored when writing/appending strings #60552
Closed
fs: add c++ fast path for writeFileSync string utf8 #49884
Merged
This was referenced Aug 20, 2026
fix: address all four CodeRabbit findings from merged PR #5 jpka/no-undo#6
Merged
feat(campaign): キャンペーンの永続記録(#1815 PR1b) receptron/mulmoterminal#1841
Merged
refactor(registry): publish workspace state after durable writes dohchq/dohc#903
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@mcollina mcollina mcollina approved these changes
@watilde watilde watilde approved these changes
@LiviaMedeiros LiviaMedeiros LiviaMedeiros approved these changes
+2 more reviewers
@hhjmmmmmmmm hhjmmmmmmmm hhjmmmmmmmm left review comments
@targos targos targos approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue-squash PRs the Commit Queue should land as one squashed commit. fs Issues and PRs related to file-system APIs and the fs module. notable-change PRs with changes that should be highlighted in changelogs.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@cjihrig @nodejs-github-bot @mcollina @watilde @targos @LiviaMedeiros @hhjmmmmmmmm @anonrig
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.