-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Adding sequential read as the file option in ReadAllBytes #40213
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
This seems reasonable/safe, we already use SequentialScan for other similar methods, and StreamReader/StreamWriter always use it (thus also File.ReadAllText, WriteAllText etc) What about File.InternalWriteAllBytes, WriteAllTextAsync, and AppendAllTextAsync. Should those have it? |
I think that makes sense, I'd want to validate it with someone else though (relatively new to .NET contributing and internals) so cc: @jkotas thoughts? |
https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea#caching-behavior says that |
@jkotas, right but I see it's on StreamWriter even in .NET Framework. |
If we were do add it to the file writing helpers, I would like to see data that prove it helps and does not hurt. |
For sure. Anyway I think this change can go ahead as its. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@QueenCitySmitty Thank you!
@jkotas thank YOU for letting me contribute.. first time! :D |
@QueenCitySmitty you are welcome here. Would you be interested in another contribution? eg anything marked milestone 5.0 would be even better. |
Found this one in Up for Grabs, going to keep poking there, thanks for the encouragement! |
Fixing #40001, adding Sequential Read file option for ReadAllBytes in File.cs.