Slow moving files on external SD

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

Dharmendra
Junior Member
Junior Member
Posts: 5
Joined: 2017-06-12, 19:55 UTC

Post by *Dharmendra »

even if I move Total Commander app to /system/app and give it root rights, it doesn't make any difference. it still uses copy and delete commands to move a file. why my default file manager can use move command on sd and TC can't ?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48012
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Are you on Android 7? Older Android versions do NOT have the move function.

The default file manager is a system app signed either by Google or the device manufacturer. System apps do not have the ricdiculous restrictions imposed on installed apps.
Author of Total Commander
https://www.ghisler.com
Dharmendra
Junior Member
Junior Member
Posts: 5
Joined: 2017-06-12, 19:55 UTC

Post by *Dharmendra »

I am on Android 6.0, my default Android file manager provided with rom can move files without any problem but I've tried all popular file managers in play store and they all use copy and delete to move files even if I move them to /system/app
Dharmendra
Junior Member
Junior Member
Posts: 5
Joined: 2017-06-12, 19:55 UTC

Post by *Dharmendra »

how can I remove these restrictions from TC? is there any work around for rooted phone?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48012
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

You probably can't - "system" is on a different partition of the flash memory than the user data, so the files need to be copied then deleted.
Author of Total Commander
https://www.ghisler.com
Dharmendra
Junior Member
Junior Member
Posts: 5
Joined: 2017-06-12, 19:55 UTC

Post by *Dharmendra »

it looks like you misunderstood my comment. by saying move to /system/app I ment to say that I made them system app, ofcourse data and system are different partitions so we need to copy and delete, but as my OS is rooted I moved all popular file managers from market to system partition in the hope that it might remove the restriction you mentioned earlier, but it doesn't. moving a file from external sd card to some other folder in external sd card also uses copy and delete command even when TC is system app (only my defaults file manager supplied with ROM does the magic and can move it).

anyway it may be because they are not signed with some system certificate as you said. thank you for your valuable time.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48012
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Giving the Total Commander apk root rights doesn't help at all - it's just a zip containing java byte code and a few C libraries, not executable code. TC usually calls the shell via "su" and then uses the shell command "mv" to move the file, something like this:
sendShellRequest("mv \""+escapeName(fullsrc)+"\" \""+escapeName(fulltrg)+"\"")

Does "rename" within the same folder work? It uses the same command.
Author of Total Commander
https://www.ghisler.com
Dharmendra
Junior Member
Junior Member
Posts: 5
Joined: 2017-06-12, 19:55 UTC

Post by *Dharmendra »

Yes, I've tried moving 1 GB file and renaming within same folder works fine, but moving to other folder takes one minute as it uses copy and delete. I also have tried 'mv' command using a terminal emulator and it can move files within external sd without any problem (within folder and to the other folders). looks like TC is not using same command, otherwise it would give me same result...!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48012
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

OK, I will check it in the debugger.
Author of Total Commander
https://www.ghisler.com
beholder
Junior Member
Junior Member
Posts: 3
Joined: 2008-03-28, 21:04 UTC

Post by *beholder »

This issue still persists, samsung galaxy j3, android 5.11.

I have tried moving large files from sd to same sd with the stock "My Files" app and it was instant. Total cmd copies and deletes instead, making the "moving' extremely slow. Please look into it, a lot of people have samyong phones.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48012
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

"My Files" is a system app, it has more rights than user-installed apps. Moving files on SD card is only possible on Android 7 and newer, sorry.
Author of Total Commander
https://www.ghisler.com
beholder
Junior Member
Junior Member
Posts: 3
Joined: 2008-03-28, 21:04 UTC

Post by *beholder »

I see, was pondering about the same thing. Can't you just issue some kind of terminal request which would take care of moving? Perhaps I am too spoiled from Windows though.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48012
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

No, unfortunately there isn't any such command. :(
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48012
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Normal Java file functions cannot write on external SD card. You need to use the Documents API, DocumentsContract.

Reaming is done with renameDocument. It does NOT work between two folders, only within the same folder.

Moving is done with moveDocument. But this is only supported in Android 7 (API Level 24) and newer.
Author of Total Commander
https://www.ghisler.com
Post Reply