> I cannot seem to delete a soft link (ln -s) that is pointing 
> to a directory without renaming the directory first. If I try 
> to delete the link it complains that the link is a directory 
> (which it is pointing to). If I delete using rm -rf, it 
> deletes the directory that is pointed to but not the link -- 
> I have been burned by that one!
> 
> FreeBSD 4.3
> 
> Here is a little test:
> 
> %pwd
> /tmp
> %mkdir me
> %cd /root
> %ln -s /tmp/me MyTmp
> %rm -f MyTmp/
> rm: MyTmp/: is a directory
> %
> %rm -rf MyTmp/  (deletes the directory it points to)
> %rm -f MyTmp    (deletes the link)
> %

Try not using the trailing slash:

===[root] /data/test # ls
===[root] /data/test # ln -s /tmp/me MyTmp
===[root] /data/test # ls
MyTmp@
===[root] /data/test # rm -f MyTmp/
===[root] /data/test # ls
MyTmp@
===[root] /data/test # rm MyTmp
===[root] /data/test # ls
===[root] /data/test # 


Also, don't do is as root like me :)



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message

Reply via email to