Posts

Post not yet marked as solved
8 Replies
6.1k Views
Hello all,I have a large application written in C that needs to be able to scan the contents of the user's Documents (and other) folder(s). I'm aware that this permision mechanism has changed in Catalina, but I'm totally unable to get it to work.The underlying symptom is that opendir fails and errno is EPERM.Note, that I CAN read and write files in ~/Documents, and I'm able to do that without ever having prompted the user.Note also, that the bash "find" command, when called via Terminal, CAN scan the directory, AFTER it has prompted the user, (and I guess it uses a similar opendir/readdir mechanism),I've tried a number of things:NSDocumentsFolderUsageDescription I've added the following to Info.plist <key>NSDocumentsFolderUsageDescription</key> <string>application needs Documents access</string>I've drag-dropped the application to the "Full Disk Access" section of "Security & Firewall".I've used the process described here: https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow to make sure that the bundle is properly notarized.None of these things allow opendir to succeed (and none them result in a dialog containging "<app> Would like to access files in your Documents folder").Is there an API I should be calling to provoke the dialog and to grant the requred permissions?Many Thanks,John.
Posted Last updated
.