Skip to main content

What it flags

A straight-line loop passes each byte buffer to a known Node fs.writeSync or awaited FileHandle.write call and discards its result. For the async form, the handle must come from a local open and stay within direct write and close calls. A successful write may report fewer bytes than requested. Advancing to the next buffer then loses the unwritten suffix.

How to review or fix

Check the returned count. If the entire chunk must be written, retry only the remaining range and handle zero progress and errors. If the caller expects one attempt, report a short write explicitly.