PCLStorage
PCLStorage copied to clipboard
IFolder.CheckExistsAsync - different behavior between Desktop and UWP
In UWP, the following code would return ExistenceCheckResult.NotFound.
In Desktop, LocalStorage is essentially ignored in the code below, and the result returned is ExistenceCheckResult.FileExists ...
var result = await FileSystem.Current.LocalStorage.CheckExistsAsync("e:\\dir1\\dir2\\file.xml");
The reason is due to the (documented) behavior of Path.Combine, which is used in the Desktop implementation of IFolder.CheckExistsAsync:
public static string Combine(string path1, string path2)
If path2 contains an absolute path, this method returns path2.
Can someone comment on whether this is intentional behavior or a bug in IFolder.CheckExistsAsync?
Same question here.
+1