Some of my users running MacOS are facing a problem I cannot reproduce.
When first running and registering the plugin I create a path in the ~/Music/Audio Music Apps/ directory using something like the following:
File file = File::getSpecialLocation(File::userMusicDirectory) .getChildFile("Audio Music Apps") .getChildFile(JucePlugin_Manufacturer) .getChildFile(JucePlugin_Name) .getChildFile("myfile"); file.create(); file.replaceWithText("some content");
I do not test for errors.
I then read that same file on subsequent run of the plugin.
This works for pretty much all users, but it seems to fail for a few of them, that consequently need to register each time they run the plugin
It appears create() does fail for them, and although they already have the ~/Music/Audio Music Apps/ path, the JucePlugin_Manufacturer and JucePlugin_Name ones are not created.
To solve the problem they need to create the path themself, and then the plugin creates the file without issue.
I plan on showing a clear message asking to contact support when create() fails, but I don’t understand why it fails as that directory should not require specific rights from what I understand.
Any idea of what could be the cause here, and how to avoid the problem?