[Sug] Add special icons for symbolic link file/directory

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

Post Reply
DeathStalker
Junior Member
Junior Member
Posts: 30
Joined: 2011-06-10, 19:33 UTC
Location: Russia, Saint-Petersburg

[Sug] Add special icons for symbolic link file/directory

Post by *DeathStalker »

It would be very convenient if you add a special icons for symbolic links file/directory.

For example (symlink folders):
[img]http://img804.imageshack.us/img804/9986/screenshot2d.jpg[/img]

PS. For symlink files do likewise.
TC 7.56a, Win 7 x64
TC for Android 1.0 rc1, HTC Desire | rooted stock Gingerbread (3.14.405.1) | S-OFF

-----------------------------
Sorry for my bad English
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunately Total Commander knows nothing about links in normal mode, only in root mode (folders where normal users don't have read rights). There seems to be no Java function to detect links. Maybe I can show them with a special icon in such root folders.
Author of Total Commander
https://www.ghisler.com
DeathStalker
Junior Member
Junior Member
Posts: 30
Joined: 2011-06-10, 19:33 UTC
Location: Russia, Saint-Petersburg

Post by *DeathStalker »

I have root in my phone.
For example result shell command toolbox ls -a -l in the directory /data:

Code: Select all

-rw-rw-rw- root     root            0 2011-06-20 19:09 log.txt
drwx------ system   system            2011-06-20 10:26 backup
drwxrwx--t system   misc              2011-06-20 19:08 misc
drwx------ root     root              2011-06-20 10:26 property
lrwxrwxrwx root     root              2011-06-16 00:35 drm -> /data/local
drwxr-xr-x system   system            2011-06-19 00:41 tombstones
-rw-rw-r-- root     radio      155648 2011-06-18 20:11 fb-phone-daemon.log
drwxr-x--- root     log               2011-06-16 00:35 dontpanic
drwxrwx--x shell    shell             2011-06-16 01:18 local
drwxrwxr-x system   system            2011-06-20 19:07 system
lrwxrwxrwx root     root              2011-06-16 01:07 app -> /sd-ext/app
lrwxrwxrwx root     root              2011-06-16 01:07 app-private -> /sd-ext/app-private
lrwxrwxrwx root     root              2011-06-16 01:07 dalvik-cache -> /sd-ext/dalvik-cache
drwxrwx--x system   system            2011-06-20 10:28 data
drwxrwx--- root     root              2011-06-16 00:35 lost+found
And result shell command toolbox ls -a -l in the directory /system/xbin:

Code: Select all

...
...
...
lrwxrwxrwx root     root              2011-06-16 01:05 addgroup -> /system/xbin/busybox
lrwxrwxrwx root     root              2011-06-16 01:05 adduser -> /system/xbin/busybox
lrwxrwxrwx root     root              2011-06-16 01:05 su -> /system/bin/su
lrwxrwxrwx root     root              2011-06-16 01:05 ls -> /system/xbin/busybox
lrwxrwxrwx root     root              2011-06-16 01:05 lsattr -> /system/xbin/busybox
lrwxrwxrwx root     root              2011-06-16 01:05 lsmod -> /system/xbin/busybox
lrwxrwxrwx root     root              2011-06-16 01:05 lspci -> /system/xbin/busybox
lrwxrwxrwx root     root              2011-06-16 01:05 lsusb -> /system/xbin/busybox
lrwxrwxrwx root     root              2011-06-16 01:05 lzcat -> /system/xbin/busybox
lrwxrwxrwx root     root              2011-06-16 01:05 lzma -> /system/xbin/busybox
lrwxrwxrwx root     root              2011-06-16 01:05 lzop -> /system/xbin/busybox
lrwxrwxrwx root     root              2011-06-16 01:05 lzopcat -> /system/xbin/busybox
lrwxrwxrwx root     root              2011-06-16 01:05 makedevs -> /system/xbin/busybox
lrwxrwxrwx root     root              2011-06-16 01:05 makemime -> /system/xbin/busybox
lrwxrwxrwx root     root              2011-06-16 01:05 man -> /system/xbin/busybox
lrwxrwxrwx root     root              2011-06-16 01:05 md5sum -> /system/xbin/busybox
lrwxrwxrwx root     root              2011-06-16 01:05 mdev -> /system/xbin/busybox
-rwsr-xr-x root     root      1867568 2008-08-01 16:00 busybox
-rwsr-xr-x root     root       887168 2008-08-01 16:00 openvpn
-rwsr-xr-x root     root          479 2008-08-01 16:00 iproute-wrapper
drwxr-xr-x root     root              2011-06-16 01:18 bb
TC 7.56a, Win 7 x64
TC for Android 1.0 rc1, HTC Desire | rooted stock Gingerbread (3.14.405.1) | S-OFF

-----------------------------
Sorry for my bad English
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks, I have now added code for the next beta where TC shows the link target (with ->) and <lnk> in the size column. However, this will only be done in folders which cannot be read with Java functions, like /data. The Jave functions don't allow to get the link target.
Author of Total Commander
https://www.ghisler.com
Gadgeteer
New Member
New Member
Posts: 1
Joined: 2012-04-09, 23:05 UTC

symbolic links

Post by *Gadgeteer »

Hi

Is there a tutorial anywhere on how to create symbolic links in Android using Total Commander?

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

Post by *ghisler(Author) »

You need to create a button with type "Shell command", then set the command either to
sh (for non-rooted devices)
or
su (for rooted devices)
Parameters:
ln -s "%P%N" "%T%N"

This should create a link of the file or folder under the cursor in the folder of the other panel. I haven't tested it, so please be careful.
Author of Total Commander
https://www.ghisler.com
regs
New Member
New Member
Posts: 1
Joined: 2012-05-28, 09:56 UTC

Post by *regs »

works well, moved some large folder from internal storage to external sd card.

but there is a one thing. when i tryed to move one folder back, i forgot to delete symlink first. so it just deleted folder.

it needs some check whatever there is a symlink or not - stop moving/copying, or delete symlink and proceed.
User avatar
CoMiKe
Senior Member
Senior Member
Posts: 285
Joined: 2003-05-05, 17:45 UTC
Location: Salamanca, Spain

Post by *CoMiKe »

Hi Christian.

Take a look at these pages. They reveal a possible solution to the problem using Java code:

http://stackoverflow.com/questions/7281612/android-determining-a-symbolic-link

http://stackoverflow.com/questions/813710/java-1-6-determine-symbolic-links
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I'm already doing this now when the user uses the search function. It would probably be too slow for browsing folders, especially with many subfolders.
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

ghisler(Author) wrote:It would probably be too slow for browsing folders, especially with many subfolders.
What if it will be disabled by default? Though rarely, but this feature could be used to look for symlinks (that I would like to add in TC4A ignore list.)
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Post Reply