TC refuses to copy files to USB Flash Drive

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

Post Reply
TanTek
New Member
New Member
Posts: 1
Joined: 2020-12-07, 06:58 UTC

TC refuses to copy files to USB Flash Drive

Post by *TanTek »

Hi,
I am using a Juniper Systems Mesa2 with Android V5.1.1 AOSP.

TC will not allow me to create a folder on any external USB Flash Drive (UFD), or copy or move any files to the UFD.

A folder creation attempt terminates with this error: "Could not create folder!"

A copy operation fails with this error:
"Error writing to target file!"
"/storage/usbcard1/....

I can see and read files on the UFD, and copy files from the UFD to the Mesa2.

The Mesa2 comes with the ASTRO file manager app (V4.6.3-4play). ASTRO can create folders on the same UFD, and copy files to the UFD. (It can't move files though, so that's why I tried using TC.)

I have searched the TC forums, but can't find a solution to this problem.
Does anyone know of a solution please?

Best regards,
TanTek
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: TC refuses to copy files to USB Flash Drive

Post by *DrShark »

When I had the same problem with my Android 5.1 device, which can't write with TC4A to USB OTG drive, but can with built-in device file manager, I reported this by email to Christian Ghisler. As he explainbed, TC cannot write to on-the-go devices on Android 5.x because Total Commander for Android, to write to external media on Android 5.x and newer, has to use the Storage Access Framework API (SAF itself is introduced in Android 4.4), however, on Android 5.x it only works with externel SD cards, but not for USB OTG drives (this shouldn't be a problem on Android 6 and newer).

It means that in case of on-the-go on Android 5.x, Android SAF tree dialog may appear on 1st attempt to write to OTG drive, but in that tree dialog OTG drive path is not listed, so SAF basically doesn't give user a way to set OTG as a path for which user could grant write access TC. If to pick wrong path in that SAF dialog, TC will then show various write errors on attemts to write into OTG device path, depending on from what TC function write operation goes.

Furtheremore, on Android 5.x TC has another SAF-related limitation, not directly related to OTG: TC doesn't show "Add location" item, which shows SAF tree dialog to pick a path for writing, in own homefolder. As Christian Ghisler explained, he decided not to show "Add location" on Android 5 due to some probems, reported in the past to him, with SAF API on Android 5. But when I had external SD Card (not USB OTG!) installed in my Android 5.1 device, AFAIR I gave TC write permission via SAF dialog which appeared on first write attempt to it, so this way it may work I guess.

The possible solution to write to USB OTG on Android 5 from TC which Christian Ghisler suggested is to try USB plugins which use low level USB-related Android API instead of SAF to write to OTG devices (they are listed here: http://www.ghisler.com/androidplugins/googleplay/; I haven't tried them yet and still use built-in file manager to write to OTG on my Android 5 device).

P.S. Reading from USB OTG on Android 5 may also be a problem for TC - it may not show OTG drive in list of drives in home folder, and since SAF tree dialog doesn't show it either, in case when some device manufacturers decide to mount it in not starndard location it may not be that easy for user to open it from TC. For example, on my device the USB OTG is mounted in /data/system/scsi/Disk1/. TC doesn't even show it in home folder because in mounts file the rule to mount is written as:

Code: Select all

/dev/block/vold/8:1 /data/system/scsi/Disk1 vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
and, as Christian Ghisler explained:
Christian Ghisler wrote:TC looks for OTG locations in /proc/mounts, but only in some specific locations to avoid false positives. For example, it doesn't look under /data because this is normally reserved for user/system data, not for mounting file systems...
So user have to find and bookmark such path in TC manually for at least read only access...
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: TC refuses to copy files to USB Flash Drive

Post by *ghisler(Author) »

Writing to external SD cards and USB sticks is restricted to system apps on Android 5. ASTRO is probably preinstalled as a system app, so it's allowed to write, while all other apps are not.
Author of Total Commander
https://www.ghisler.com
Post Reply