Slow moving files on external SD

Support for Android version of Total Commander

Moderators: Hacker, Stefan2, white, sheep

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

Post by *Dharmendra » 2017-06-12, 20:01 UTC

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: 36354
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2017-06-15, 08:42 UTC

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
http://www.ghisler.com

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

Post by *Dharmendra » 2017-06-21, 08:28 UTC

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 » 2017-06-21, 08:32 UTC

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: 36354
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2017-06-22, 08:32 UTC

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
http://www.ghisler.com

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

Post by *Dharmendra » 2017-06-22, 16:45 UTC

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: 36354
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2017-06-26, 13:57 UTC

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
http://www.ghisler.com

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

Post by *Dharmendra » 2017-06-26, 20:23 UTC

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: 36354
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2017-06-29, 08:38 UTC

OK, I will check it in the debugger.
Author of Total Commander
http://www.ghisler.com

beholder
Junior Member
Junior Member
Posts: 3
Joined: 2008-03-28, 21:04 UTC

Post by *beholder » 2018-01-22, 15:46 UTC

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: 36354
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2018-01-22, 15:54 UTC

"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
http://www.ghisler.com

beholder
Junior Member
Junior Member
Posts: 3
Joined: 2008-03-28, 21:04 UTC

Post by *beholder » 2018-01-22, 16:54 UTC

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: 36354
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2018-01-25, 10:06 UTC

No, unfortunately there isn't any such command. :(
Author of Total Commander
http://www.ghisler.com


User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 36354
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2018-07-02, 07:57 UTC

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
http://www.ghisler.com

Post Reply