-
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
InMemoryDirectoryInfo does not work with absolute paths on Windows #88596
Comments
Tagging subscribers to this area: @dotnet/area-system-io Issue DetailsDescriptionvar attempt1 = new InMemoryDirectoryInfo(@"", new[] { @"C:\my\happy\path" }); // crashes because the root is empty
Reproduction StepsSee description Expected behaviorI expect there to be a way to use absolute paths on Windows in combination with Actual behaviorSee description Regression?No response Known WorkaroundsI have to use paths relative to the root of the filesystem var attempt2 = new InMemoryDirectoryInfo(@"C:\", new[] { @"my\happy\path" });
var matcher = new Matcher();
matcher.AddInclude(@"my\happy\path");
Debug.Assert(matcher.Execute(attempt2).HasMatches) // passes ConfigurationNo response Other informationNo response
|
Tagging subscribers to this area: @dotnet/area-extensions-filesystem Issue DetailsDescriptionvar attempt1 = new InMemoryDirectoryInfo(@"", new[] { @"C:\my\happy\path" }); // crashes because the root is empty var attempt2 = new InMemoryDirectoryInfo(@"C:\", new[] { @"C:\my\happy\path" });
var l = attempt2.EnumerateFileSystemInfos().ToList(); // returns "my\" instead of "C:\", so any matcher that starts with C:\ cannot be used with this
var matcher = new Matcher();
matcher.AddInclude(@"C:\my\happy\path");
Debug.Assert(matcher.Execute(attempt2).HasMatches) // fails Reproduction StepsSee description Expected behaviorI expect there to be a way to use absolute paths on Windows in combination with Actual behaviorSee description Regression?No response Known WorkaroundsI have to use paths relative to the root of the filesystem var attempt3 = new InMemoryDirectoryInfo(@"C:\", new[] { @"my\happy\path" });
var matcher = new Matcher();
matcher.AddInclude(@"my\happy\path");
Debug.Assert(matcher.Execute(attempt3).HasMatches) // passes ConfigurationNo response Other informationI expect that allowing
|
This looks like a duplicate of #50648. |
I don't think it is. Another way to phrase this issue is that My perspective is that it would be simplest to consider the drive letter part of a Windows path as another directory, but |
Description
Reproduction Steps
See description
Expected behavior
I expect there to be a way to use absolute paths on Windows in combination with
Matcher
andInMemoryDirectoryInfo
Actual behavior
See description
Regression?
No response
Known Workarounds
I have to use paths relative to the root of the filesystem
Configuration
No response
Other information
I expect that allowing
InMemoryDirectoryInfo
to take an empty root is required to resolve this issue.The text was updated successfully, but these errors were encountered: