Uh oh!
There was an error while loading. Please reload this page.
Support unseekable filestream when ReadAllBytes[Async] - #58434
Conversation
ghost
commented
Aug 31, 2021
Tagging subscribers to this area: @dotnet/area-system-io Issue Details…dAllBytes[Async]. Fix #58383 , will update PR status when it is ready for review.
|
…issue-58383-SupportUnSeekableReadBytes # Conflicts: # src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.cs
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
It looks like there is some difference in how character devices are treated in .NET 5 vs. .NET 6. e.g. this simple console program: usingSystem;usingSystem.IO;usingSystem.Threading;usingSystem.Threading.Tasks;//using Xunit;FileTestsfileTests=new();awaitfileTests.ReadAllBytes_NonSeekableFileStream_InUnix();Console.WriteLine("Passed!");publicclassFileTests{// [Fact]publicasyncTaskReadAllBytes_NonSeekableFileStream_InUnix(){varpath="/dev/tty";if(!File.Exists(path)){thrownewException(path+" is not available in this environment.");}varcontentBytes=newbyte[]{1,2,3};using(varcts=newCancellationTokenSource()){TaskwritingTask=File.WriteAllBytesAsync(path,contentBytes,cts.Token);cts.CancelAfter(TimeSpan.FromMilliseconds(500));awaitwritingTask;}}}prints @tmds, @stephentoub, is this a known breaking change? |
stephentoub
commented
Sep 29, 2021
Not to my knowledge. |
tmds
commented
Sep 29, 2021
On Linux, it prints From the CI stack trace it looks like the @am11 can you create an issue for this? |
am11
commented
Sep 29, 2021
adamsitnik
left a comment
There was a problem hiding this comment.
LGTM, big thanks for your contribution @lateapexearlyspeed !
adamsitnik
commented
Nov 2, 2021
/backport to release/6.0 |
Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1412920156 |
@adamsitnik backporting to release/6.0 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: lateapexearlyspeed-issue-58383 Support unseekable filestream when ReadAllBytes[Async].
Applying: issue-58383 Refine code; Add test cases.
Applying: the docs were wrong, offsets are not ignored for non-seekable files
Using index info to reconstruct a base tree...
M src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.cs
Falling back to patching base and 3-way merge...
Auto-merging src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.cs
CONFLICT (content): Merge conflict in src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0003 the docs were wrong, offsets are not ignored for non-seekable files
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |
Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
…dAllBytes[Async].
Fix#58383 , will update PR status when it is ready for review.