Allowed Folders
Allowed Folders are locations the users expect the recipe to interact with. This makes the user experience transparent and more reliable. Magnetron has a default folder structure;
folders.home
folders.output
folders.temp
folders.recipes
folders.content
folders.bin
These folder variables will point to a folder named magnetron.dev_data
or magnetron.app_data
respectively, located in the OS user program data folder.
ie. on windows C:\Users\...\AppData\Roaming\magnetron.dev_dat
and on MacOs /Users/.../Library/magnetron.dev_data
.
These are editable from the settings page in the application. The file name of the recipe will automatically be added as sub-folder name.
In most cases, keeping to the default folders should suffice. Adding or changing the folders in the app settings should only be done if strictly necessary from a user perspective. It can be done with these functions.
- getAllowedFolders
- gets the path of an allowed folder from the app settings.
- removeAllowedFolders
- removes the path of an allowed folder from the app settings.
- setAllowedFolders
- Sets the path of an allowed folder from the app settings. This folder has to exists or the path will be empty.
examples
// Add and remove a folder path variable in the app settings
function TestGlobalVar()
{
if (setAllowedFolders("test_folder", folders.temp + gvar.pss + "test")) // asks for confirmation
{
echo(getAllowedFolders("test_folder"));
removeAllowedFolders("test_folder"); // asks for confirmation
}
}