dsplaisted / PCLStorage

PCL Storage - Portable Storage APIs
Microsoft Public License
305 stars 94 forks source link

IFolder.CheckExistsAsync - different behavior between Desktop and UWP #59

Open mr-intj opened 7 years ago

mr-intj commented 7 years ago

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?

xavier-rigau commented 7 years ago

Same question here.

devapalanisamy commented 6 years ago

+1