Skip to content

Commit

Permalink
Fixed double sync on open when truncating
Browse files Browse the repository at this point in the history
  • Loading branch information
james-pre committed Oct 31, 2024
1 parent d614105 commit 7c9735e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/emulation/promises.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ async function _open(path: fs.PathLike, _flag: fs.OpenMode, _mode: fs.Mode = 0o6
*/
if (isTruncating(flag)) {
await handle.truncate(0);
await handle.sync();
}

return handle;
Expand Down
1 change: 0 additions & 1 deletion src/emulation/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ function _openSync(path: fs.PathLike, _flag: fs.OpenMode, _mode?: fs.Mode | null

if (isTruncating(flag)) {
file.truncateSync(0);
file.syncSync();
}

return file;
Expand Down

0 comments on commit 7c9735e

Please sign in to comment.