Accessing PropertiesFile from Plugin

 

JULES: Could you change the PropertiesFile Class, that is possible to save its content in

~/Music/Audio Music Apps

 

I think this is the most relevant post, from this thread

 

Hello, 

Just got a reply from Apple in dev portal. 


Here are the current recommendations: 

(a) Safest assumption 
An AudioUnit has full write access to ~/Music (each AudioUnit host needs this directory anyway, Logic Pro X/GarageBand X and MainStage store their settings, etc in ~/Music/Audio Music Apps). Each plugin will therefore have access to all files in this directory. You could create a hidden directory by prefixing "." in front of the name. I would use the AU-BUNDLE-ID as a directory name to avoid conflicts. This is compatible with or without a sandbox on all OS X versions. 

(b) Work-around for all other directories relative to $HOME 
All access to the file system relative to $HOME will end up inside the container of the sandboxed host. To avoid that, you need to find the real home directory (see the sample code below), which will work just fine, because GBX provides full filesystem access. Right now this access is necessary anyway to maintain compatibility with e.g. sample libraries and files somewhere on the system or external hard drives. We plan to move to secure bookmarks in the future. 

+-(NSString *)realHomeDirectory 
+{ 
+ struct passwd *pw = getpwuid(getuid()); 
+ if (pw == nil) 
+ return nil; 
+ return [NSString stringWithUTF8String:pw->pw_dir]; 
+} 

(c) Additional recommendations 
The following directories seem reasonable for an AudioUnit, if ~/Music is not an option. This way at least the data is in clearly defined directories. 

- ~/Library/Application Support/<AU-BUNDLE-ID> 
- ~/Library/Caches/<AU-BUNDLE-ID> 
- ~/Library/Preferences/<AU-BUNDLE-ID>

 

 

1 Like