> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# discarded-file-write-count

> A chunk-writing loop discards the byte count returned by a low-level Node write.

## 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.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.