PCLStorage icon indicating copy to clipboard operation
PCLStorage copied to clipboard

IFolder.CheckExistsAsync - different behavior between Desktop and UWP

Open mr-intj opened this issue 7 years ago • 2 comments

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?

mr-intj avatar Jun 09 '17 19:06 mr-intj

Same question here.

xavier-rigau avatar Jun 09 '17 19:06 xavier-rigau

+1

devapalanisamy avatar Apr 12 '18 15:04 devapalanisamy