xoofx / zio

A cross-platform abstract/virtual filesystem framework with many built-ins filesystems for .NET
BSD 2-Clause "Simplified" License
817 stars 61 forks source link

SearchPattern unexpected behaviour for * #42

Open onepiecefreak3 opened 4 years ago

onepiecefreak3 commented 4 years ago

As the search under windows, I expect the * to match everything in the given path. So if I create a searchPattern like this:

var path = new UPath("/folder1");
var search = "*";
var pattern = SearchPattern.Parse(ref path, ref search);

I wouldn't expect it to match a path not beginning with folder1, like /folder2/test.

Is that intended behaviour or a bug? Because the code states the scenario of having the * as the search pattern as an optimized and most common case. I agree that it is the most common case, but only in combination with the pre-defined path not being ignored.