A suggested PDir option...

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
#1
PDir, a very useful command that I almost couldn't live without, has, of course, options for file and directory names in any of several formats (SFN path, LFN path, etc.). But what it doesn't have, as far as I can tell, is an option to display for a directory symbolic link or junction the directory that that symbolic link or junction is pointing to, and that would be real handy for my current purposes, so much so that I am strongly considering other ways that I can get that information (batch files, executable programs, etc.) because I really need it, so much so that I can not achieve the goal that I am trying to achieve without that information. I have no strong opinion on whether directory symbolic links and junctions would be selected for output/displayed in different ways or one field option displaying both without distinction, with possibly yet another option to tell you whether it is a symbolic link or junction because I don't see any real, substantial reason, why it would matter. (And because my eyesight is bad and it's there and I am just not seeing it, I apologize and please reply with the information on how to get that data.)
 
#2
---- Original Message ----
From: mathewsdw
To: ESFabian@zenge.org
Sent: Tuesday, 2011. March 29. 01:36
Subject: [Suggestions-t-2731] A suggested PDir option...

| PDir, a very useful command that I almost couldn't live without, has,
| of course, options for file and directory names in any of several
| formats (SFN path, LFN path, etc.). But what it doesn't have, as far
| as I can tell, is an option to display for a directory symbolic link
| or junction the directory that that symbolic link or junction is
| pointing to...

I have been using the ability of the command to pass report the value of variable functions, including user defined ones. I regularly use the built-in functions @JUNCTION, @INODE, @LINKS, @VERINFO, and the UDFs @RELFILE, @RELPATH (see below). I created aliases for all usual combinations (with a systematic naming convention).

relfile=%@quote[%@replace[%_cwds,,%@full[%&]]]
relpath=%@quote[%@replace[%_cwds,,%@path[%@full[%&]]]]

Try it, you might like it!
--
HTH, Steve
 
#3
---- Original Message ----
From: mathewsdw
To: ESFabian@zenge.org
Sent: Tuesday, 2011. March 29. 01:36
Subject: [Suggestions-t-2731] A suggested PDir option...

I have been using the ability of the command to pass report the value of variable functions, including user defined ones....

Try it, you might like it!
--
HTH, Steve
Steve, thank you for your response and I didn't know about those functions, but they really don't help. I don't use junctions anymore, I strictly use symbolic links (a lot of them, and I don't know exactly why I use symbolic links vs. junctions other than the fact that they existed on other operating systems that I have used in past), and @Junction doesn't work for symbolic links. But it turns out that there is a "@SYMLINK" function that I (and maybe you) didn't know about and it returns exactly the information I'm looking for. However, I haven't tried it (because I no longer use junctions and don't believe I have any on this machine and I'm lazy), but I imagine it would quite easy to create a user-defined function that wraps "%Junction" and "@SymLink" in a "@If" function, and you it would probably even be easy to return a "not junctioned and not symbolically linked" value if it is the directory you are examining is not a junction or symbolic link.

- Dan