-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Labels
Description
Describe the bug
When trying to create a file within a directory that is part of the app (such as the Documents directory), it returns a null file and the file is not created. This happens only when using IStorageFolder::CreateFileAsync
. Creating the file using regular File.Create
calls works successfully.
I suspect this is because of this check. StartAccessingSecurityScopedResource
will return false
if the user is unable to access the resource OR if the resource is already in the app sandbox (such as the documents folder).
Other file operations succeed because they don't check the result of StartAccessingSecurityScopedResource
.
To Reproduce
- Access the app documents folder
- Attempt to create a test file within that directory
- The test file will not be created
var documents = await storageProvider.TryGetWellKnownFolderAsync(WellKnownFolder.Documents);
var test = await documents.CreateFileAsync("test.txt");
// test is null, it should have been created
Expected behavior
No response
Avalonia version
11.3.4
OS
iOS
Additional context
No response