Title: Trouble removing symbolic links to directories in RHEL3 WS
O/S: RHEL 3WS
up2date version: 4.4.69-20
I have searched this topic on LinuxQuestions.org and have found a lot of good information but not really relating to my problem. I use symbol links within my development web server to provide access to directories that are reused in different projects, mostly for convenience for developers using html text editors and Dreamweaver. This also fixes a problem on Windows clients using Dreamweaver when a new site is defined as a subfolder inside another defined site, and Dreamweaver complains about it.
First, I have no problems with creating and deleting symbolic links to individual files.
$ touch dummyFile.php
$ ln -s ./dummyFile.php dummy.ln.php
$ ls -l
-rw-rw-r-- 1 web web 0 Feb 22 11:34 dummyFile.php
lrwxrwxrwx 1 web web 12 Feb 22 11:35 dummy.ln.php -> ./dummyFile.php
$ rm dummy.ln.php
Symbolic link is deleted just fine. Now we create a symbolic link to a directory.
$ mkdir dir_dummy
$ ln -s ./dir_dummy dummy.ln.dir
$ ls -l
drwxrwxr-x 2 web web 4096 Feb 22 11:34 dir_dummy
lrwxrwxrwx 1 web web 12 Feb 22 11:35 dummy.ln.dir -> ./dir_dummy/
$ rm dummy.ln.dir
rm: cannot remove `dummy.ln.dir/': Not a directory
$ rmdir dummy.ln.dir
rmdir: `dummy.ln': Not a directory
I am the first to admit that I may not be using symbolic links correctly or should be using hard links for this exact purpose, but like many in unix, you try something and if it works, then you continue to use it until you find a problem. So, there could very well be a simple solution to remove this type of directory link or someone may know a better way to solve the core problem, other than just saying to create new top level folder for all new projects. In recent months, I have switched mostly to using Zend Studio which has built in support for multiple paths but several other developers want to stick to Dreamweaver.