Parameters
- filePath
- An absolute path to a file.
- fileAccess
- A constant that defines how the file can be accessed.
Return Value
File stream.
Exception | Description |
---|---|
System.IO.FileNotFoundException | Thrown if file must be opened but file is not found. |
System.InvalidOperationException | Thrown if file must be created but file exists already. |
System.TimeoutException | Thrown if file is locked. |
The method will create new file if fileAccess is set to System.IO.FileAccess.Write; otherwise, the method will open a file.
Target Platforms: .NET9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5