Skip to content
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

System.IO files cleanup #61413

Merged
merged 5 commits into from
Nov 12, 2021
Merged

System.IO files cleanup #61413

merged 5 commits into from
Nov 12, 2021

Conversation

adamsitnik
Copy link
Member

For the description please refer to commit messages.

@ghost
Copy link

ghost commented Nov 10, 2021

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

Issue Details

For the description please refer to commit messages.

Author: adamsitnik
Assignees: -
Labels:

area-System.IO

Milestone: 7.0.0

public static SafeFileHandle OpenHandle(string path, FileMode mode = FileMode.Open, FileAccess access = FileAccess.Read,
FileShare share = FileShare.Read, FileOptions options = FileOptions.None, long preallocationSize = 0)
{
Strategies.FileStreamHelpers.ValidateArguments(path, mode, access, share, bufferSize: 0, options, preallocationSize);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: should FileStreamHelpers be moved out of Strategies?

@@ -731,5 +774,176 @@ private static void Validate(string path, Encoding encoding)
if (path.Length == 0)
throw new ArgumentException(SR.Argument_EmptyPath, nameof(path));
}

private static byte[] ReadAllBytesUnknownLength(FileStream fs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did anything change in these methods, or you just moved them between files?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just moved them and I plan to send a separate PR to change them from using FileStream to RandomAccess

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool

@adamsitnik adamsitnik merged commit 87a44c3 into dotnet:main Nov 12, 2021
@adamsitnik adamsitnik deleted the minorFilesCleanup branch November 12, 2021 15:13
@EgorBo
Copy link
Member

EgorBo commented Nov 16, 2021

Probably improved dotnet/perf-autofiling-issues#2375 (windows-x64)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants