Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 19 Apr 2019, 18:17
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
File Explorer That Shows realpath (i.e. no symlinks)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [22 Posts]   Goto page: 1, 2 Next
Author Message
s243a

Joined: 02 Sep 2014
Posts: 1535

PostPosted: Wed 12 Dec 2018, 04:05    Post subject:  File Explorer That Shows realpath (i.e. no symlinks)  

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:

cd `realpath .`
rox


It would be nice if there was a button on the file explorer that could do this.
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1819
Location: Japan

PostPosted: Wed 12 Dec 2018, 05:18    Post subject:  

Well....MMview comes to mind
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.
mmview.png
 Description   
 Filesize   78.83 KB
 Viewed   310 Time(s)

mmview.png

Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 1535

PostPosted: Wed 12 Dec 2018, 14:09    Post subject:  

MochiMoppel wrote:
Well....MMview comes to mind
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:

/root/Downloads/pt/Haliburtan_Profits_-id1B2M2Y8AsgTpgAmY7PhCfg==/parent/Haliburtan_Profits_-id1B2M2Y8AsgTpgAmY7PhCfg==

I follow a symlink called parent

the real path is:
Code:

/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:
/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 Sad

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/haliburtan-profits-the-iraq/id11286468

I'm not sure if I forgot to save any links for this topic or if the site deleted them Sad. 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, 01:38; edited 1 time in total
Back to top
View user's profile Send private message 
mikeslr


Joined: 16 Jun 2008
Posts: 3096
Location: 500 seconds from Sol

PostPosted: Wed 12 Dec 2018, 16:03    Post subject: xfe?  

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.'
path2Realfile.png
Description  xfe's display showing location of actual file when symlink selected
png

 Download 
Filename  path2Realfile.png 
Filesize  71.19 KB 
Downloaded  57 Time(s) 
Back to top
View user's profile Send private message 
mikeslr


Joined: 16 Jun 2008
Posts: 3096
Location: 500 seconds from Sol

PostPosted: Wed 12 Dec 2018, 20:53    Post subject: Actually MMview seems the more adaptable  

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.
Shell opened via Commandbox.png
 Description   One of MMView's perks
 Filesize   68.16 KB
 Viewed   221 Time(s)

Shell opened via Commandbox.png

Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 13914
Location: Gatineau (Qc), Canada

PostPosted: Wed 12 Dec 2018, 21:08    Post subject:  

Hi s243a.

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

BFN.
Good-old-mc-does-it.jpg
 Description   
 Filesize   153.39 KB
 Viewed   217 Time(s)

Good-old-mc-does-it.jpg


_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1819
Location: Japan

PostPosted: Wed 12 Dec 2018, 23:56    Post subject:  

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:
/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 Sad
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
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 13914
Location: Gatineau (Qc), Canada

PostPosted: Thu 13 Dec 2018, 01:14    Post subject:  

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
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 1535

PostPosted: Thu 13 Dec 2018, 01:27    Post subject:  

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.
Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 1535

PostPosted: Thu 13 Dec 2018, 02:01    Post subject: Re: xfe?  

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:

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.
Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 1535

PostPosted: Thu 13 Dec 2018, 03:44    Post subject:  

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:
/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 Sad
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/apyl5zgj0qbgu8d/pt.tar.gz?dl=0

you have to extract it to
Code:

/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.
Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 1535

PostPosted: Thu 13 Dec 2018, 03:52    Post subject:  

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 Smile

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.
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1819
Location: Japan

PostPosted: Thu 13 Dec 2018, 04:21    Post subject:  

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 Crying or Very sad

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 .
Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 1535

PostPosted: Thu 13 Dec 2018, 14:28    Post subject: Re: Actually MMview seems the more adaptable  

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 Smile 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 Smile
Back to top
View user's profile Send private message 
bigpup


Joined: 11 Oct 2009
Posts: 12015
Location: S.C. USA

PostPosted: Thu 13 Dec 2018, 20:49    Post subject:  

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.
Screenshot.jpg
 Description   
 Filesize   53.41 KB
 Viewed   113 Time(s)

Screenshot.jpg


_________________
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 Shocked
YaPI(any iso installer) http://www.murga-linux.com/puppy/viewtopic.php?t=107601
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [22 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0622s ][ Queries: 13 (0.0078s) ][ GZIP on ]