Skip to content

The file contents are lost after writing #245

Open

Description

@huangke1993

I used FileIniDataParser.WriteFile to save content.Sometimes,The file contents are lost after writing.And i solved this problem by adding writer.Flush() in the StreamIniDataParser.WriteData() method.
``

Activity

  1. MooWeii commented on Mar 20, 2023

    @MooWeii

    I hava the same issue too.

  2. haraldrohan commented on Sep 19, 2026

    @haraldrohan

    The historical StreamIniDataParser.WriteData implementation only calls writer.Write(...) and does not flush the StreamWriter. FileIniDataParser.WriteFile normally flushes during disposal, but callers using WriteData directly can observe an empty or incomplete file until the writer is flushed. Adding writer.Flush() after writing would be a small, targeted fix and would preserve ownership of the writer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions