-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File.ReadAllBytes* should support non-seekable files #58383
Comments
Tagging subscribers to this area: @dotnet/area-system-io Issue DetailsAs of today, The following call to
The funny thing is that we already almost support it: runtime/src/libraries/System.Private.CoreLib/src/System/IO/File.cs Lines 341 to 348 in d033e1a
We need:
|
Hi @adamsitnik could you please help on question: |
@lateapexearlyspeed Appologies for the delay, I've missed GH notificaiton for your question. You can take a look at the tests that I am trying to add in #58506 : runtime/src/libraries/System.IO.FileSystem/tests/RandomAccess/NonSeekable_AsyncHandles.cs Lines 21 to 25 in 2b1510f
in your case you should be able to create a string pipeName = FileSystemTest.GetNamedPipeServerStreamName();
string pipePath = Path.GetFullPath($@"\\.\pipe\{pipeName}");
using (var server = new NamedPipeServerStream(pipeName, PipeDirection.InOut))
using (FileStream fs = new FileStream(pipePath, FileMode.Open, access, FileShare.None, FileOptions.Asynchronous)) |
@adamsitnik Thanks for help, test cases finished in PR, sync version test for
which can be reproduced by following call:
Not sure is there issue inside FileStream for async operation ? |
Most likely. I am going to build your fork and try to repro it locally |
It turned out that the official docs were not telling the exact truth.
I've added an cc @stephentoub |
Hi @adamsitnik I marked PR as ready for review now. |
As of today,
File.WriteAllBytes*
APIs support non-seekable files, butFile.ReadAllBytes*
don't.The following call to
FileStream.Length
is going to throw:runtime/src/libraries/System.Private.CoreLib/src/System/IO/File.cs
Line 336 in d033e1a
The funny thing is that we already almost support it:
runtime/src/libraries/System.Private.CoreLib/src/System/IO/File.cs
Lines 341 to 348 in d033e1a
We need:
The text was updated successfully, but these errors were encountered: