Skip to content

config: fsync config file#689

Merged
vgough merged 1 commit intovgough:masterfrom
rfjakob:fsync
Feb 23, 2026
Merged

config: fsync config file#689
vgough merged 1 commit intovgough:masterfrom
rfjakob:fsync

Conversation

@rfjakob
Copy link
Collaborator

@rfjakob rfjakob commented Feb 22, 2026

Three improvements:

  1. write(2) errors are detected now, because writer.into_inner()
    flushes BufWriter's buffer
  2. Errors on close(2) don't matter anymore. Before, they were not
    detected at all (see 3rd paragraph at
    https://doc.rust-lang.org/std/fs/struct.File.html ) and could
    cause data loss
  3. File is safely on disk even if the PC crashes before the underlying
    filesystem decides to flush it's writeback buffers

Three improvements:

1) write(2) errors are detected now, because writer.into_inner()
   flushes BufWriter's buffer
2) Errors on close(2) don't matter anymore. Before, they were not
   detected at all (see 3rd paragraph at
   https://doc.rust-lang.org/std/fs/struct.File.html ) and could
   cause data loss
3) File is safely on disk even if the PC crashes before the underlying
   filesystem decides to flush it's writeback buffers
@vgough vgough merged commit b0c2892 into vgough:master Feb 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants