This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Finding junction points in cygwin
Actually the behavior is even stranger... renaming and then deleting
junctions creates spurious directories.
echo "This is a test file" >| targetfile
mkdir targetdir
echo "This is a test dir file" >| targetdir/targetdirfile
junction.exe junctionfile targetfile
junction.exe junctiondir targetdir
ls -Ag
drwxr-xr-x 1 None 0 2009-11-09 11:56 junctiondir/
-rw-r--r-- 1 None 20 2009-11-09 11:55 junctionfile
drwxr-xr-x 1 None 0 2009-11-09 11:56 targetdir/
-rw-r--r-- 1 None 20 2009-11-09 11:55 targetfile
mv junctionfile newjunctionfile
mv junctiondir newjunctiondir
ls -Ag
drwxr-xr-x 1 ???????? 0 2009-11-09 11:57 junctiondir/
drwxr-xr-x 1 ???????? 0 2009-11-09 11:57 junctionfile/
drwxr-xr-x 1 None 0 2009-11-09 11:56 newjunctiondir/
-rw-r--r-- 1 None 20 2009-11-09 11:55 newjunctionfile
junction.exe -d junctionfile
junction.exe -d junctiondir
ls -Ag
drwxr-xr-x 1 None 0 2009-11-09 11:56 newjunctiondir/
-rw-r--r-- 1 None 20 2009-11-09 11:55 newjunctionfile
drwx------+ 1 None 0 2009-11-09 12:01 targetdir/
drwx------+ 1 None 0 2009-11-09 12:01 targetfile/
Now this seems to be sheer madness.
The original file and directory names have reappeared!
However 'targetdir' is now empty and 'targetfile' is also an (empty)
directory!
ls -Ag targetdir targetfile newjunctiondir
newjunctiondir:
total 1
-rw-r--r-- 1 None 24 2009-11-09 11:56 targetdirfile
targetdir:
total 0
Interestingly, in Windows explorer, renaming seems to do the right thing -
it renames the target.
Interestingly, Windows explorer allows both file and directory junctions to
be removed (though it displays file junctions as non-openable directories).
Not sure why it does this since I thought junctions could only be deleted
using '-d'.
So it seems to me, we have the following conclusions:
- cygwin treatment of junctions is not consistent with Windows or with
notion of symlinks. It also leaves weird residua after renaming junctions.
- Windows junctions are also messed up but not as much
targetfile:
total 0
--
View this message in context: http://old.nabble.com/Finding-junction-points-in-cygwin-tp26260606p26270112.html
Sent from the Cygwin list mailing list archive at Nabble.com.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple