Copy file.
Prefix the filename with / (i.e. relative path) to copy a file on the SD card.
For instance /myFile.txt will copy the file /mnt/sdcard/myFile.txt. To copy
assets packaged with an application (also works for the Companion) start
the fromFilename with // (two slashes). However you can't copy
files to the assets. If a fileName starts with file:///
you can specify a complete path to the file.
Note: For copying a file to an external sdcard, there are the following restrictions:
an app can only write to its own directory but can't create its own directory (example: appinventor.ai_MxyzptlkHavok.fileTest).
Subdirectories will only be created if an app is writing to its own directory. Thank you MxyzptlkHavok
for your tests!
If you try to write to another directory on the external sdcard,
you will get an error message "open failed: EACCES (Permission
denied)", see also
here.
for the record, i am using emulator Nox , which have root access
, also have directory "Al" build in SD. tried your third example already which is copy file from SD to SD and it works.
nice extension by the way.
when i trying to copy from assets to sdcard. I saw some strange message.
To copy assets packaged with an application (also works for the Companion) start the fromFilename with // (two slashes).