What are the different FileMode options available in FileStream?
Ask by ICSM Computer
Updated 05 May 2025
The
FileModeenumeration in C# defines how theFileStreamshould open or create a file. Here's a breakdown of the available options:FileModeOptionsAppendCreateCreateNewIOException.OpenFileNotFoundException.OpenOrCreateTruncateExample Usage
Each
FileModecan be paired withFileAccessandFileSharefor more control.