I’m putting this in the Audio Plugins category, since it seems to be a plugin-related behavior.
Forgive me if I’m doing something stupid here, but it seems that if I create a file (in this example, for global settings), only the instance of the plugin that created the file can delete it. Example behaviors:
On first instance, the plugin checks to see if a global settings file exists, and if it doesn’t, it creates one. In hosts that run a validation (like Bitwig), they effectively instance the plugin completely, so this settings file is created. So future instances can no longer delete or alter it, only append it.
If I make it so the settings load from default if there’s no global settings file, and later write a settings file, any instance but the one that created it can not overwrite it.
File tmp = globalSettingsDirectory.getChildFile(“quanta.settings”);
bool result = tmp.deleteFile();
if (result) DBG(“Deleted”);
In that example, if existsAsAFile returns true, result returns false. I want the prefs to be per user, obviously, so I’m using the userApplicationDataDirectory special location, but I’ve tried it with pretty much everything including root, and it just won’t delete. While I’m not that interested in deleting the file, I do need to use replaceWithText(), which has a delete() in it.
Note this is Win10; I haven’t tried it on my macOS machine yet.
EDIT: Tried it on my Mac, and it works fine; replaceWithText() and delete() work as expected. So this is a Windows 10 issue, it would seem.