You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically, line #62 in StorageFile.cs public bool Exists => this.Originator != null && File.Exists(this.Path);
and a similar check in StorageFolder.cs don't work as expected on UWP due to differences in app-based permission scheme in UWP. The .Exists propery appears to always return false, even is the app has permission to the directory.
I have a fork that simply removes the System.IO.File/Directory.Exists call and rely only on the Windows.Storage API to gaurantee that a Windows.Storage.StorageFile/StorageFolder can only be created ( != null) if the file/folder exists. This seems to be the case, and the intent of this API.
This is what I changed it to, and it seems to work in my testing:
The text was updated successfully, but these errors were encountered:
jasells
changed the title
System.IO.File.Exists and System.IO.Directory.Exists don't behave as epxect on UWP
System.IO.File.Exists and System.IO.Directory.Exists don't behave as expected on UWP
Sep 14, 2018
Basically, line #62 in StorageFile.cs
public bool Exists => this.Originator != null && File.Exists(this.Path);
and a similar check in StorageFolder.cs don't work as expected on UWP due to differences in app-based permission scheme in UWP. The .Exists propery appears to always return false, even is the app has permission to the directory.
I have a fork that simply removes the System.IO.File/Directory.Exists call and rely only on the Windows.Storage API to gaurantee that a Windows.Storage.StorageFile/StorageFolder can only be created ( != null) if the file/folder exists. This seems to be the case, and the intent of this API.
This is what I changed it to, and it seems to work in my testing:
public bool Exists => this.Originator != null;
Here's my PR.
Here's the original issue that lead to this.
The text was updated successfully, but these errors were encountered: