Is there a consistent directory?
Moderator: Martin
Is there a consistent directory?
As far as I know there are different folder structures on different devices. How can I ensure that my flow that uses actions like "write to file" will work on every device?
Re: Is there a consistent directory?
The folder structure/directory names can vary a lot across devices. /mnt/sdcard/ is available on many devices to access the primary external storage, probably for compatibility reasons of older apps.
I will add a new function getExternalStorageDir() in the next version to get the root directory of the external storage so you could build actions like Write to File: abc to {getExternalStorageDir()}/file.txt.
I will add a new function getExternalStorageDir() in the next version to get the root directory of the external storage so you could build actions like Write to File: abc to {getExternalStorageDir()}/file.txt.
Re: Is there a consistent directory?
It's a nice solution. Thanks.
Re: Is there a consistent directory?
Could you also make a function to get the path of the inserted external SD card?
Re: Is there a consistent directory?
To my knowledge there's still no good way to get the root of the real SD card that works on all devices.
You could ask the user to provide the path and store it in a global variable. Unofficial function getExternalFilesDirs() in a script returns a list of places Automagic could place files. You could loop over this list to determine if the second entry is the external sd card. Some devices might have multiple external sd cards.
Regards,
Martin
You could ask the user to provide the path and store it in a global variable. Unofficial function getExternalFilesDirs() in a script returns a list of places Automagic could place files. You could loop over this list to determine if the second entry is the external sd card. Some devices might have multiple external sd cards.
Regards,
Martin