Skip to content

Conversation

@DoctorKrolic
Copy link
Contributor

Fixes: #69604

Also while working on a core fix (commit 1) I noticed that dwFileAttributes is often compared to -1. Windows documentation reffers to it as INVALID_FILE_ATTRIBUTES, so I decided to name this constant for clarity

@filipnavara
Copy link
Member

@dotnet/area-system-io Can someone look at the PR?

@DoctorKrolic
Copy link
Contributor Author

Me waiting for a review on a commutiny PR:
Sad-Pablo-Escobar-meme-1c1uej

@lindexi
Copy link
Member

lindexi commented Aug 15, 2025

I was full of expectations, but I had been waiting for a long time. LoL

@DoctorKrolic
Copy link
Contributor Author

@lindexi Yeah, same for me. It seems that area-System.IO team is just a myth and these people don't exist in reality. Comapring to other .NET ecosystem repos (mainly roslyn), the expirience of contributing to this one is way worse, I just feel forgotten and unnoticed. Given that you are a .NET foundation member, maybe you can influence that? I already asked for a review several times myself (deleted those messages to reduce noise), asked for attention in Discord, which led to @filipnavara tagging related team directly again, even posted a meme and yet this PR still slowly sinks in the zombie PR limbo

@jeffhandley jeffhandley added this to the 11.0.0 milestone Sep 2, 2025
@jeffhandley jeffhandley requested a review from jozkee September 2, 2025 02:48
@DoctorKrolic
Copy link
Contributor Author

@jozkee PTAL

Copy link
Member

@jozkee jozkee left a comment

Choose a reason for hiding this comment

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

Apologies for the delay.

/// </item>
/// </list>
/// </summary>
private static bool IsPipePath([NotNullWhen(true)] string? path)
Copy link
Member

Choose a reason for hiding this comment

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

Consider moving this method to PathInternal.Windows.cs

}

[Fact]
[PlatformSpecific(TestPlatforms.Windows)] // Windows-specific pipes behavior
Copy link
Member

@jozkee jozkee Sep 12, 2025

Choose a reason for hiding this comment

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

Suggested change
[PlatformSpecific(TestPlatforms.Windows)] // Windows-specific pipes behavior
[PlatformSpecific(TestPlatforms.Windows)]

I think the test name + this attribute is self-explanatory, consider removing these comments.

[PlatformSpecific(TestPlatforms.Windows)] // Windows-specific pipes behavior
public void CheckPipeExistsViaFileApi()
{
var pipeName = GetNamedPipeServerStreamName();
Copy link
Member

Choose a reason for hiding this comment

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

Just by looking at GetNamedPipeServerStreamName

return @"LOCAL\" + Guid.NewGuid().ToString("N");

The IsInAppContainer scenarios will be adding another segment to pipe names meaning IsPipePath as is won't work. It may be tricky to figure out how to test that one.

I suspect is related to UWP cc @adamsitnik @danmoseley.

Comment on lines +248 to +250
var pipeName = GetNamedPipeServerStreamName();
new NamedPipeServerStream(pipeName).Dispose();
Assert.False(Exists(@$"\\.\pipe\{pipeName}"));
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
var pipeName = GetNamedPipeServerStreamName();
new NamedPipeServerStream(pipeName).Dispose();
Assert.False(Exists(@$"\\.\pipe\{pipeName}"));
Assert.False(Exists(@$"\\.\pipe\{pipeName}"));

No need to create/delete the pipe?

}

ReadOnlySpan<char> pathSpan = path.AsSpan();
if (!pathSpan.StartsWith(@"\\"))
Copy link
Member

Choose a reason for hiding this comment

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

I think the method should also handle forward slashes.

Copy link
Member

Choose a reason for hiding this comment

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

FillAttributeInfo also impacts FIle.GetAttributes, can you please add tests for that?

// 1) '.' or 'serverName'
// 2) Constant 'pipe' segment
// 3) Pipe name
return written == 3 && pathSpan[segments[1]].SequenceEqual("pipe");
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be a case insensitive comparison.

@jozkee jozkee added the needs-author-action An issue or pull request that requires more info or actions from the author. label Sep 16, 2025
@dotnet-policy-service dotnet-policy-service bot removed this from the 11.0.0 milestone Oct 15, 2025
@filipnavara filipnavara reopened this Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.IO community-contribution Indicates that the PR has been added by a community member needs-author-action An issue or pull request that requires more info or actions from the author.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using File.Exists to check the pipe created will make the NamedPipeClientStream connect fail

5 participants