-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Description
Two semi-related issues:
writeFileSyncbumpspositionincorrectly, causing it to drift in iteration three and onwards. It seems thatwrittenis 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
writeFileorwriteFileSynciterates multiple times, unless running on Linux.positionstarts out asnullso first write is OK, but thenpositionwill 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).
DavyKoravand and CubeFlix
Metadata
Metadata
Assignees
Labels
No labels