Skip to content

Commit

Permalink
Ensure byte flush on file write
Browse files Browse the repository at this point in the history
  • Loading branch information
richarddavison committed Dec 19, 2023
1 parent 7b27a99 commit 509b32b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/fs/write_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@ pub async fn write_file<'js>(ctx: Ctx<'js>, path: String, data: Value<'js>) -> R
file.write_all(&bytes)
.await
.or_throw_msg(&ctx, &format!("Can't write \"{}\"", &path))?;
file.flush()
.await
.or_throw_msg(&ctx, &format!("Can't write \"{}\"", &path))?;

Ok(())
}

0 comments on commit 509b32b

Please sign in to comment.