Windows 2000 Junction Points

Kim, Anthony
Thu Dec 6 07:56:00 GMT 2001

Windows 2000 (having NTFS 5.0) allows the creation of directory
symbolic links. This can be used as mount points for hard drive
volumes or to symlink directories across file systems. In the
literature, the directory links are called "junction points".

Disk Administration snap-in can be used to mount a drive to a
directory or you can use linkd.exe (ResKit) or junction.exe

This is the closest thing I can find to simulate:

ln -s /source /destination

Now here's my question:

When you perform a directory symlink in cygwin, you end up with a
.LNK file even though you can cd into the link.

$ pwd
$ ln -s /cygdrive/c /mnt/test
$ ls -l
total 20
dr-xr-xr-x    6 Administ Administ        0 Dec  6 09:47 ./
dr-xr-xr-x   12 Administ Administ     4096 Nov 28 12:48 ../
dr-xr-xr-x   12 Administ Administ     8192 Dec  6 09:47 c/
dr-xr-xr-x    3 Administ Administ     4096 Dec  3 12:48 d/
dr-xr-xr-x    5 Administ Administ     4096 Dec  3 12:48 e/
drwxr-xr-x    1 vciadmin Administ        0 Dec  4 08:35 h/
lrwxrwxrwx    1 vciadmin Administ       94 Dec  6 09:47 test -> /cygdrive/c/

$ cd test
$ ls
<directory listing>

This works as expected. However, from outside cygwin:

$ cmd

 Volume in drive G is DATA
  Volume Serial Number is 98D5-B7E1

   Directory of G:\cygwin\mnt

   12/06/2001  09:47a      <DIR>          .
   12/06/2001  09:47a      <DIR>          ..
   11/28/2001  11:26a      <JUNCTION>     c
   11/28/2001  11:26a      <JUNCTION>     d
   11/28/2001  11:27a      <JUNCTION>     e
   12/04/2001  08:34a      <JUNCTION>     h
   12/06/2001  09:47a                  94 test.lnk

So the effect is lost.

Because hard links work in cygwin as expected, is it far fetched
for ln -s <directory> <linkname> to create actual junction points
instead of .LNK files?

If I'm way off base here, please feel free to let me know :)


Unsubscribe info:
Bug reporting:

More information about the Cygwin mailing list