File Explorer That Shows realpath (i.e. no symlinks)

Using applications, configuring, problems
Message
Author
s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

File Explorer That Shows realpath (i.e. no symlinks)

#1 Post by s243a »

Is there a file explorer that I can use which will show the real path in the location bar (i.e. no symlinks)

The workaround is to open a terminal and type:

Code: Select all

cd `realpath .`
rox
It would be nice if there was a button on the file explorer that could do this.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#2 Post by MochiMoppel »

Well....MMview comes to mind Image
In below example ROX-Filer would show tooltip "Symbolic link to abiword_16.xpm", which is not the abiword_16.xpm next to this file.

Nevertheless ROX-Filer shows what it calls the "Real directory" in the Properties dialog - which can be misleading. Unfortunately ROX-Filer shows only the first link target, suggesting that this the realpath. However if the link target is another link (not too uncommon) you won't see the "real" path at the end of such a chain.

In MMview you will see the "end of the line". The path right of the arrow is always a real path, never another symlink .... at least that's how it is supposed to work.
Attachments
mmview.png
(78.83 KiB) Downloaded 452 times

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#3 Post by s243a »

MochiMoppel wrote:Well....MMview comes to mind Image
In below example ROX-Filer would show tooltip "Symbolic link to abiword_16.xpm", which is not the abiword_16.xpm next to this file.

Nevertheless ROX-Filer shows what it calls the "Real directory" in the Properties dialog - which can be misleading. Unfortunately ROX-Filer shows only the first link target, suggesting that this the realpath. However if the link target is another link (not too uncommon) you won't see the "real" path at the end of such a chain.

In MMview you will see the "end of the line". The path right of the arrow is always a real path, never another symlink .... at least that's how it is supposed to work.
Thanks for the info. Is there a way to make it only show the realpath. Here is an example:

I'm in a directory called:

Code: Select all

/root/Downloads/pt/Haliburtan_Profits_-id1B2M2Y8AsgTpgAmY7PhCfg==/parent/Haliburtan_Profits_-id1B2M2Y8AsgTpgAmY7PhCfg==
I follow a symlink called parent

the real path is:

Code: Select all

/root/Downloads/pt/s243a/2_-_root_node_(my_real_tree_Pearl_Trees_Version_1.0)/Places/Asia/Middle_East/Iraq/Foreign_Politics_(Iraq)/The_Iraq_War_II/Pree_Iraq_War_II/Motivations_for_the_Iraq_War
but this is what I see in the bottom text box:

Code: Select all

/root/Downloads/pt/Haliburtan_Profits_-id1B2M2Y8AsgTpgAmY7PhCfg==/parent/Haliburtan_Profits_-id1B2M2Y8AsgTpgAmY7PhCfg==  ➡  /root/Downloads/pt/Haliburtan_Profits_-id1B2M2Y8AsgTpgAmY7PhCfg== │ x-directory
which doesn't seem to show the real path at all :(

IF your curious what I'm doing here, I'm converting an export from pearltrees (in NETSCAPE-Bookmark-file-1 format). And I'm converting it into a directory structure with HTML pages for the links.
https://pastebin.com/nZHb7FJb

When the path gets two long, the script create a new folder and symlinks it to the parent folder. The example above seems to actually have no bookmarks saved for this folder/page
http://www.pearltrees.com/s243a/halibur ... id11286468

I'm not sure if I forgot to save any links for this topic or if the site deleted them :(. I randomly selected the example from the output.

**Note that the script requires the coreutils version of "realpath" and it must be in the searchpath before the busybox version.
Last edited by s243a on Thu 13 Dec 2018, 05:38, edited 1 time in total.

User avatar
mikeslr
Posts: 3890
Joined: Mon 16 Jun 2008, 21:20
Location: 500 seconds from Sol

xfe?

#4 Post by mikeslr »

Hi s243a

See Attached Screenshot. The file-manager is Xfe under 32-bit Tahrpup. A 64-bit version is available: https://sourceforge.net/projects/xfe/. If --Big IF-- I understand what you're looking for, this seems to provide it. However, while the location of the actual file is displayed, the display is not amenable to 'cut & paste'. However, to be displayed it must be 'written' somewhere, or 2 or more files must have been read and combined. Figuring out how the display was produced and how to use that information is 'beyond my paygrade.'
Attachments
path2Realfile.png
xfe's display showing location of actual file when symlink selected
(71.19 KiB) Downloaded 100 times

User avatar
mikeslr
Posts: 3890
Joined: Mon 16 Jun 2008, 21:20
Location: 500 seconds from Sol

Actually MMview seems the more adaptable

#5 Post by mikeslr »

Hi again s243a,

Re-read the posts. To me it appears that MMView comes closer to your goals. Both it and Xfe appear to be displaying both ends of a symbolic link, but not the actual path between them.

Unlike xfe, MMview is an application created by a member of this Community. I would expect that he can recall or figure out how it produces its display. Unlike xfe, it is possible to 'cut and paste' the content of the display. That suggests that somewhere there is (at least a temporary) file which has been generated by following the actual path. It should be possible to capture each step of the process used by MMview to do that. Also note that the top menu of MMview has a panel named "Commandbox". Clicking it opens a shell which accepts commands. You already know the command needed to return the actual path. A named bash script should be able to generate the results you want. But, don't ask me how. I suspect that the command grep is involved after which my mind gets fuzzy. Or maybe before.
Attachments
Shell opened via Commandbox.png
One of MMView's perks
(68.16 KiB) Downloaded 355 times

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#6 Post by musher0 »

Hi s243a.

Good old Midnight Commander does it. Please see attached capture.

BFN.
Attachments
Good-old-mc-does-it.jpg
(153.39 KiB) Downloaded 352 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#7 Post by MochiMoppel »

s243a wrote:Is there a way to make it only show the realpath
Sounds like a good idea. Technically very easy, but before that we have to confirm that it indeed shows the realpath. You claim that it doesn't.
s243a wrote:but this is what I see in the bottom text box:

Code: Select all

/root/Downloads/pt/Haliburtan_Profits_-id1B2M2Y8AsgTpgAmY7PhCfg==/parent/Haliburtan_Profits_-id1B2M2Y8AsgTpgAmY7PhCfg==  ➡  /root/Downloads/pt/Haliburtan_Profits_-id1B2M2Y8AsgTpgAmY7PhCfg== │ x-directory
which doesn't seem to show the real path at all :(
Then you are not in this directory as you explained. You must have merely selected this directory.
You wrote that you "follow a symlink called parent". What is the full path of this symlink and what is shown in the statusbar when you select this symlink?

And for the benefit of my strained eyes: Can you find a simpler example? :wink:

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#8 Post by musher0 »

FWIW:

I don't see the benefit of ALWAYS showing the real path of a symlink.
It's a symlink for a reason.

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#9 Post by s243a »

musher0 wrote:FWIW:

I don't see the benefit of ALWAYS showing the real path of a symlink.
It's a symlink for a reason.

BFN.
Normally you would be right but not for my application. In my application the real path shows how the information is organized in a class hierarchy.

Appending a symblink called "parent" to the path, gives no information about where one really is whereas the realpath shows how the folders are broken up into categories and sub-categories.

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

Re: xfe?

#10 Post by s243a »

mikeslr wrote:Hi s243a

See Attached Screenshot. The file-manager is Xfe under 32-bit Tahrpup. A 64-bit version is available: https://sourceforge.net/projects/xfe/. If --Big IF-- I understand what you're looking for, this seems to provide it. However, while the location of the actual file is displayed, the display is not amenable to 'cut & paste'. However, to be displayed it must be 'written' somewhere, or 2 or more files must have been read and combined. Figuring out how the display was produced and how to use that information is 'beyond my paygrade.'
Cool. I'll try compiling the latest version of XFE for 32bit dpup stretch. I'll also watch the MMview thread, since MochiMoppel may add the functionality I want in the future and if not maybe some day I'll take a crack at it.

It's actually taking longer to compress the output than to actually produce the output but when it finially is compressed I will add a download link to this thread. I will also publish the input and script to github. Currently the latest version is only on pastebin:
https://pastebin.com/nZHb7FJb

I did find something that works quite closely to what I want. I noticed that on my version of "dpup strech I have, the "emelFM2" file manager. I'm not sure if this is something the puppy came with or was something I installed. Anyway, the cool thing about this file manager is that there is a window at the bottom where I can type commands in. So I can type in this window:

Code: Select all

realpath .
and then copy the output to the address bar and hit enter. Not quite as seamless as I had in mind but I can do this pretty fast and as I pluss I don't have to switch windows.

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#11 Post by s243a »

MochiMoppel wrote:
s243a wrote:Is there a way to make it only show the realpath
Sounds like a good idea. Technically very easy, but before that we have to confirm that it indeed shows the realpath. You claim that it doesn't.
s243a wrote:but this is what I see in the bottom text box:

Code: Select all

/root/Downloads/pt/Haliburtan_Profits_-id1B2M2Y8AsgTpgAmY7PhCfg==/parent/Haliburtan_Profits_-id1B2M2Y8AsgTpgAmY7PhCfg==  ➡  /root/Downloads/pt/Haliburtan_Profits_-id1B2M2Y8AsgTpgAmY7PhCfg== │ x-directory
which doesn't seem to show the real path at all :(
Then you are not in this directory as you explained. You must have merely selected this directory.
You wrote that you "follow a symlink called parent". What is the full path of this symlink and what is shown in the statusbar when you select this symlink?

And for the benefit of my strained eyes: Can you find a simpler example? :wink:
I made a zip file of the directory 6MB. It was created from a bookmark file with less than 72000 items. I say less than 72000 because I don't think that private folders were exported. You can download the output at:
https://www.dropbox.com/s/apyl5zgj0qbgu ... ar.gz?dl=0

you have to extract it to

Code: Select all

/root/Downloads/pt
and there should be two subfolders under pt. The first one is called "s243a" which is the root of the folder structure. The other directory is called, "1" which contains all the paths that were wrapped because they are too long.

The reason that you have to extract it to exactly the above folder is that the symbolic links are absolute. I will modify the script to make the symbolic links relative.

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#12 Post by s243a »

musher0 wrote:Hi s243a.

Good old Midnight Commander does it. Please see attached capture.

BFN.
Thankyou for letting me know about this tool. I like commandline tools :)

I don't think that it does quite what I want...or at least not as seamlessly. However, since I can quickly switch back and forth between folder view and terminal view with cntrl-o, and cd lets me change the folder path it still works quite well for what I"m trying to do. My approach with midnight commander is:
1. Switch to the terminal with cntrl-o
2. Type "cd realpath ."
3. Switch back to folder view with cntrl-o.

This is quite quick to do even if not perfectly seamlessly. Note that as I mentioned above I can do something similar with "emelFM2". I think I prefer "emelFM2" because I can adjust the borders to show only one folder window. I'm not sure if I can do this with midnight commander or not. That said terminal based tools will work in many situations where x-based tools won't.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#13 Post by MochiMoppel »

musher0 wrote:I don't see the benefit of ALWAYS showing the real path of a symlink.
I do.
s243a asked to show ONLY the real path which is basically a good idea since the path of a selected symlink is already evident from the tree folder structure. The info in the status bar does not necessarily have to repeat the path of the selected symlink. The reason why I show BOTH, symlink path and real path, is to
- make status bar content consistent with the content for non-symlinks
- allow to copy any of the paths to the clipboard for further use. This is the main reason.
s243a wrote:I'll also watch the MMview thread, since MochiMoppel may add the functionality
I'm afraid that MochiMoppel still has no clue what functionality you are asking for :cry:

I'm also confused by your workaround shown in the initial post. Instead of doing your terminal stuff you could simply Shift+Click (or DblClick, depending on your configuration) the symlink in ROX-Filer, no? This is the same as "Show Target" in the menu and takes you to the real path. The only difference from your workaround is that this will not open a separate ROX-Filer window.

This would be impossible for MMview as the chooser widget can not switch the currently displayed folder programmatically. It could however open a separate ROX-Filer window with the link target.
It appears that when you say show the realpath you don't mean to see the path as a text string, you actually mean to switch to the realpath directory and see its contents .

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

Re: Actually MMview seems the more adaptable

#14 Post by s243a »

mikeslr wrote:Hi again s243a,

Re-read the posts. To me it appears that MMView comes closer to your goals. Both it and Xfe appear to be displaying both ends of a symbolic link, but not the actual path between them.
I just tried Xfe (the one from the package manager). It appears to at the bottom display the output of reading the symbolic link. This isn't exactly the same as the real path.

I recently changed the symbolic links to relative links so XFE is displaying relative links at the bottom, which is intersting :) although not what I was looking for.

So as it stands the best options, for my application are emelFM2, and "midnight commander", where emelFM2 is better if you are doing mostly x-GUI type stuff whereas "midnight commander" is better if you are doing a lot of terminal (and/or command line) stuff.

As a side note I find **XFE very slow on my system but it looks cool :)

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#15 Post by bigpup »

Rox will show the real path if you hover the mouse pointer over a symbolic link.
But I guess you want something you can highlight and copy/paste.
Attachments
Screenshot.jpg
(53.41 KiB) Downloaded 245 times
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#16 Post by MochiMoppel »

bigpup wrote:Rox will show the real path if you hover the mouse pointer over a symbolic link.
No, it will not show the real path. It shows the symlink target, which may or may not be the real path.
It also tries to show the target as a relative path while real path would always be the full, absolute file path.

williams2
Posts: 337
Joined: Fri 14 Dec 2018, 22:18

#17 Post by williams2 »

You can right click in a rox window and select
Window -- Follow Symbolic Links

For example, in the attached picture, I created a folder named 1 in /tmp (the window on the left). I made a symbolic link to 1, named 2. I created a symbolic link to 2 named 3. 4 is linked to 3 and 5 is linked to 4.

I put a file in folder 1 named this-is-dir1. You see that file if you click on 1 2 3 4 or 5. The top right window in the picture shows the file in /tmp/5/. The 3 rox windows are automatically tiled by the echinus window manager. There are no bars at the top because I configured echinus that way. You can see the path at the bottom of each rox window. The path appears if you type / and can be copied/pasted.

The bottom right window shows what happens if you select Follow Sybolic Links. Instead of /tmp/5/ it displays /initrd/mnt/tmpfs/tmp/1/. That is, it goes up until there are no symbolic links.

Running XenialPup.[/img]
Attachments
rox.png
(77.71 KiB) Downloaded 72 times

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#18 Post by s243a »

williams2 wrote:You can right click in a rox window and select
Window -- Follow Symbolic Links
Thanks for the tip, this is the most seamless approach so far and works very well. It works so well that there probably isn't much additional benefit of making it more seamless than this (unless I needed to do this operation a lot). This brings the list to three (3) file managers that can do (or sort of do) what I want. This list is:
rox
emelFM2
Midnight Commander

williams2
Posts: 337
Joined: Fri 14 Dec 2018, 22:18

#19 Post by williams2 »

You can make it easier to use rox by setting your own shortcut key. Just click Menus in rox options, click Set Keyboard Shortcuts and follow the instructions. It says to add:

gtk-can-change-accels = 1

to the hidden file /root/.gtkrc-2.0

Then you can select the item you want in the menu and instead of clicking it, press the key you want to use. Then you do not need to go in the menu to follow symbolic links, just press the key.

You can make any or all of the number keys work as bookmarks. For example, I usually set 3 to /tmp and 7 to /mnt. I have 0 set to / and 9 set to my download dir and 8 set to my video downloads. Just press ctrl+1 to set the bookmark to whatever dir you are looking at, and press 1 to come back to it anytime.

And of course, you can click Display, Save Display Settings to save the sort order etc, etc for that dir.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#20 Post by musher0 »

Hi williams2.

One should not touch files .gtkrc and .gtkrc-2.0 for the reason that they risk
being overwritten when the user changes GTK themes.

One can however add your line at the top of a file called .gtkrc.mine in /root.

IHTH.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

Post Reply