Rank, 14 days: 9 on the Bun sheet
2 people reported

All time, since Sep 13.

writeFile leaves stale trailing bytes

When the final truncation fails, as with ENOSPC or a mapped view on Windows, the old tail of the file stays in place.

Is this your bug? What gets counted gets fixed. Pile on.

Paste this into your agent. It files your report, with your error and version.

I hit this bug: rapsheet.dev/sheets/bun/issues/5449/file
Follow it to file my report. Show me the text before you send.

No install. No account. Public and anonymous. The link asks your agent for one report, nothing else. What it sends

writeFile reports success when truncation fails, leaving stale tail.

Is this your bug?

File my report
Where
node:fs API
Versions
1.4.3 to 1.4.4. Still reported on the newest version, 1.4.4.
Platforms
macOS, Windows

Not quite your bug?

  1. Empty Bun.write truncates output3 people
  2. Pending reads exit process early1 person
  3. Bun.write hangs on fetch Response3 people

Original reports2, newest first

  1. Windows: fs.writeFileSync reports success but leaves the old tail when the file has a mapped view (regression in 1.4.0)#47945
  2. fs.promises.writeFile silently succeeds when final truncation fails, leaving stale trailing bytes#42598

Do you work on Bun?

Claim its RAP Sheet to see what your users report and answer them in one place.