Closed
Description
Two semi-related issues:
writeFileSync
bumpsposition
incorrectly, causing it to drift in iteration three and onwards. It seems thatwritten
is though to be the amount just written but it is in fact the accumulated amount. This bug is not available in the asyncwriteFile
.- Append mode files will get corrupted in the middle if
writeFile
orwriteFileSync
iterates multiple times, unless running on Linux.position
starts out asnull
so first write is OK, but thenposition
will refer to a location inside an existing file, corrupting that data. Linux ignores position for append mode files so it doesn't happen there.
See https://github.com/iojs/io.js/blob/78581c8d902f2ed32712b342091d89016030e4ba/lib/fs.js#L1151-L1155 (also writeFile
and writeAll
).
Metadata
Metadata
Assignees
Labels
No labels