Files
tauri-plugins-workspace/.changes/fix-fs-write-stream-truncate.md
T
Lucas Fernandes Nogueira dcc8cb032b fix(fs): truncate the file when writeFile writes a stream (#3629)
In plugins/fs/guest-js/index.ts writeFile, the stream path opened the
file with {write, create} but no truncate, unlike the buffer path which
truncates unless `append` is set (commands.rs write_file_inner), so
shorter content left stale trailing bytes.

The stream path now passes `truncate: !options?.append`. api-iife.js
regenerated. E2E spec covers overwrite and append with a stream.
2026-10-09 13:01:30 -03:00

7 lines
238 B
Markdown

---
fs: patch
fs-js: patch
---
Fixed `writeFile` with a `ReadableStream` leaving the end of the previous contents in place when the new data is shorter. The file is now truncated first unless `append` is set, like when writing a buffer.