Inconsistent behavior in Directory.GetDirectories when using long path prefix (\\?\) #2286
Labels
area-System.IO
enhancement
Product code improvement that does NOT require public API changes/additions
Projects
Milestone
While porting to .NET Core, our test suite uncovered a difference in behavior in the Directory.GetDirectories API depending upon whether the long path prefix "\\?\" is used or not. Consider the following code:
The first call to GetDirectories throws an IOException stating
The second call to GetDirectories returns the expected (admittedly questionably so) directories and does not throw an exception.
In .NET Framework, both calls consistently throw an ArgumentException indicating the search pattern cannot contain
..\
in order to move up directories.The text was updated successfully, but these errors were encountered: