Skip to content

Open file via FileStream with ReadWrite sharing#743

Merged
SimonCropp merged 2 commits intomainfrom
Open-file-via-FileStream-with-ReadWrite-sharing
Mar 21, 2026
Merged

Open file via FileStream with ReadWrite sharing#743
SimonCropp merged 2 commits intomainfrom
Open-file-via-FileStream-with-ReadWrite-sharing

Conversation

@SimonCropp
Copy link
Copy Markdown
Owner

Replace File.OpenText(path) with a FileStream using FileMode.Open, FileAccess.Read and FileShare.ReadWrite, then wrap it in a StreamReader. This allows reading files that may be concurrently written to by other processes while preserving the existing Read(...) behavior.

Replace File.OpenText(path) with a FileStream using FileMode.Open, FileAccess.Read and FileShare.ReadWrite, then wrap it in a StreamReader. This allows reading files that may be concurrently written to by other processes while preserving the existing Read(...) behavior.
@SimonCropp SimonCropp added this to the 28.0.2 milestone Mar 21, 2026
@SimonCropp SimonCropp modified the milestones: 28.0.2, 28.1.0 Mar 21, 2026
@SimonCropp SimonCropp merged commit 4392421 into main Mar 21, 2026
5 checks passed
@SimonCropp SimonCropp deleted the Open-file-via-FileStream-with-ReadWrite-sharing branch March 21, 2026 07:12
This was referenced Apr 14, 2026
This was referenced Apr 14, 2026
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.

1 participant