The "JUNCTION" confusion with DIR at a command line

Sep 11, 2009
35
0
Portland, Or.
#1
I'm sure I'm as confused as others with the forced use of JUNCTION'd directories.

It began when I mistakenly ran TC and other programs in non-admin mode though I was an admin. Programs showed filesaves were succesful to the 'C:\' root.

BUT a DIR from TC did not show the files?! Tried several times, several programs, same results. Those other programs could 'see' those files on the 'C:\' directory, but DIR from the TC command line did not?!!!

How am I supposed to find a file that was MICROSOFT-misdirected to a different directory than I was told it DID go to?

How should I run DIR to 'find' those files in the JUNCTIONed mis-direct(ory)?
DIR Help (in TC) implies that DIR /T:J C:\ should work. It doesn't, it shows 'incorrect use'

And what is '@Junction' in TC help? If I enter it at the cmd line, it's invalid..
 
#2
I'm sure I'm as confused as others with the forced use of JUNCTION'd directories.
Hi,
In essence, a junction is a symbolic link to a directory.

To create a junction using TCC, I type;

Code:
mklink /j jlc "C:\Documents and Settings\jlc\My Documents"
which returns;

Junction created for jlc <<===>> C:\Documents and Settings\jlc\My Documents

Instead of me having to type;

Code:
C:\Documents and Settings\jlc\My Documents
I can instead just type;

Code:
C:\jlc
Any files that I create, regardless of which directory that I created them in, will appear in the other directory. Note that C:\jlc is not a real directory, but a symbolic link to C:\Documents and Settings\jlc\My Documents

This allows using C:\jlc from TCC, and from Windows Explorer.

When I am in the root directory of my drive, and type DIR, I can see C:\JLC in the directory listing as follows;

<junction>12/02/2009 7:59 <junction> JUNCTION jlc [C:\Documents and Settings\jlc\My Documents]</junction>

You could also set the COLORDIR environment variable to make a junction "jump out" at you;

</junction>
Code:
<junction></junction>set colordir=junction:red
<junction>

or whatever colour you prefer. Now when you do a DIR, your JUNCTION directories will be highlighted in red.

When I do a DIR /T, one of the directories I see is;

12/02/2009 7:59 JUNCTION <junction> ____D___L____ jlc [C:\Documents and Settings\jlc\My Documents]
</junction>

<junction>To just see the junctions, I type;

</junction></junction>
Code:
<junction><junction></junction></junction>dir /A:L
<junction><junction>

Joe

</junction></junction>
 
#4
Joe Caverly wrote:
...
I have neither Vista, nor Win7 available here, so I cannot provide an
explicit answer to the OP. However, I suspect that the "junctions" created
have the HIDDEN or SYSTEM attribute, and become visible only if explicitly
requested.
An excellent explanation of "symbolic link" is found in Wikipedia at
http://en.wikipedia.org/wiki/Symbolic_link.

| To create a junction using TCC, I type;
|
| mklink /j jlc "C:\Documents and Settings\jlc\My Documents"
|
| which returns;
|
| *Junction created for jlc <<===>> C:\Documents and Settings\jlc\My
| Documents*

Note that the MKLINK command above inverted the parameter order of the
older, but still available MKLNK command:

MKLNK existing_directory junction_to_existing_directory

or

MKLNK existing_file hard_link_to_existing_file

+++++++++++++++++++++++++++++++++++++++++++++

The message from Joe to which I am responding here has arrived with many
copies of HTML "tags" <junction> and </junction>. Viewing it in Outlook
Express either as plain text or as HTML they do not disappear, probably
because they are not really HTML tags.
--
Steve
 

rconn

Administrator
Staff member
May 14, 2008
10,588
97
#7
> DIR Help (in TC) implies that DIR /T:J C:\ should work. It doesn't, it
> shows 'incorrect use'
If you want to show junctions, you need to use /A:J. There is no /T:J
option. (/T by itself will display the attributes of each directory entry,
but it does not select them.)


> And what is '@Junction' in TC help? If I enter it at the cmd line, it's
> invalid..
It's a variable function. You use it like any other variable function, as
an argument to another command.

Rex Conn
JP Software
 
#8
If you want to show junctions, you need to use /A:J. There is no /T:J
option. (/T by itself will display the attributes of each directory entry,
but it does not select them.)
Hi,
I'm using TCC 11.00.38 Windows XP [Version 5.1.2600]
TCC Build 38 Windows XP Build 2600 Service Pack 3

In the help file, under Attribute Switches, it says that L is for Symbolic link or Junction (reparse point).

I do not see the J attribute mentioned, yet both return the same result.

Should this J option be included in the help file, or can I just not see it?

Joe
 

rconn

Administrator
Staff member
May 14, 2008
10,588
97
#9
> ---Quote (Originally by rconn)---
> If you want to show junctions, you need to use /A:J. There is no /T:J
> option. (/T by itself will display the attributes of each directory
> entry,
> but it does not select them.)
> ---End Quote---
>
> In the help file, under Attribute Switches, it says that L is for
> Symbolic link or Junction (reparse point).
>
> I do not see the J attribute mentioned, yet both return the same
> result.
>
> Should this J option be included in the help file, or can I just not
> see it?
They're equivalent. The J option was the original, but the L option was
added when Windows added symbolic link support. Microsoft added the /A:L
option at that point, so I added it to TCC. The /A:J is deprecated but
still supported for backward compatibility.

Rex Conn
JP Software
 
#10
Joe Caverly wrote:
...
| I'm using TCC 11.00.38 Windows XP [Version 5.1.2600]
| TCC Build 38 Windows XP Build 2600 Service Pack 3
|
| In the help file, under Attribute Switches, it says that L is for
| Symbolic link or Junction (reparse point).
|
| I do not see the J attribute mentioned, yet both return the same
| result.
|
| Should this J option be included in the help file, or can I just
| not see it?
J is accepted for backward compatibility. It is not used in reports. I
see no need to include it in HELP. OTOH, we ought to update our batch files
and aliases, but it is not trivial, and they would no longer work in older
versions of JPsoft command processors.
--
HTH, Steve