Switch to FileStream
/RandomAccess
for I/O if feasible (.NET 9+)
#76
Labels
area: drivers
Issues related to the terminal drivers.
state: blocked
Issues that are blocked on some other issue or work.
Milestone
A number of improvements were made to
FileStream
in .NET 6: https://devblogs.microsoft.com/dotnet/file-io-improvements-in-dotnet-6FileStream
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 useNo longer an issue as this workaround was removed.FileStream
since we need to useReadConsole
as opposed toReadFile
in that case.FileStream
yet. This would make it a functional downgrade over what we have now withUnixCancellationPipe
.RandomAccess
on Unix dotnet/runtime#96530).RandomAccess
: It would be ideal to useRandomAccess
directly, 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.
The text was updated successfully, but these errors were encountered: