Skip to main content

What it flags

Two directly connected Node filesystem streams open the same proven path. The reader uses default read options or a known literal encoding. The destination uses the default truncating mode or explicitly sets w or w+. It can discard the source before the read finishes.

How to review or fix

Write to a distinct temporary file and replace the source after the operation succeeds. Choose naming, permissions and replacement behavior for your application.