You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FileStream is now looking like a more attractive option for I/O compared to the hand-rolled interop we do right now.
That said, there are three major issues:
Windows: For as long as we need the UTF-8 input workaround (see Switch to UTF-8 input on Windows #68), we will need to keep a code path that doesn't use FileStream since we need to use ReadConsole as opposed to ReadFile in that case. No longer an issue as this workaround was removed.
Unix: There is no first-class support for asynchronous operations and cancellation in FileStream yet. This would make it a functional downgrade over what we have now with UnixCancellationPipe.
The (eventual) benefits of the switch would be improved performance, 'free' support for OS-native asynchronous operations, cancellation support, and more maintainable terminal driver code.
A number of improvements were made to
FileStreamin .NET 6: https://devblogs.microsoft.com/dotnet/file-io-improvements-in-dotnet-6FileStreamis now looking like a more attractive option for I/O compared to the hand-rolled interop we do right now.That said, there are three major issues:
Windows: For as long as we need the UTF-8 input workaround (see Switch to UTF-8 input on Windows #68), we will need to keep a code path that doesn't useNo longer an issue as this workaround was removed.FileStreamsince we need to useReadConsoleas opposed toReadFilein that case.FileStreamyet. This would make it a functional downgrade over what we have now withUnixCancellationPipe.RandomAccesson Unix dotnet/runtime#96530).RandomAccess: It would be ideal to useRandomAccessdirectly, but this is not currently possible due to arbitrary type requirements.The (eventual) benefits of the switch would be improved performance, 'free' support for OS-native asynchronous operations, cancellation support, and more maintainable terminal driver code.