Page 1 of 1
Is there a consistent directory?
Posted: 09 Jul 2014 17:22
by bichlepa
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?
Posted: 11 Jul 2014 08:32
by Martin
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.
Re: Is there a consistent directory?
Posted: 11 Jul 2014 10:43
by bichlepa
It's a nice solution. Thanks.
Re: Is there a consistent directory?
Posted: 09 May 2017 16:23
by bichlepa
Could you also make a function to get the path of the inserted external SD card?
Re: Is there a consistent directory?
Posted: 11 May 2017 19:36
by Martin
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