LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Symlinks and .. (https://www.linuxquestions.org/questions/linux-general-1/symlinks-and-388299/)

smidgie82 12-01-2005 10:46 AM

What's wrong with symlinks?
 
I don't know if this is standard behavior or not, but I'm guessing it is, since it's way too obvious to have been overlooked. I have web content stored in a directory (~/public_html/images/), and I reuse this same content in several different sites served off of the same server (served from ~/html/dir1, ~/html/dir2, etc.). So, in each site, I created a symlink to the directory (~/html/dir1/images --> ~/public_html/images).

So now, I go to ~/html/dev/images/:
Code:

cd ~/html/dev/images/
Now, if I try to go back to ~/html/dev/ from there:
Code:

cd ..
it works just fine. However, from ~/html/dev/images/, if I
Code:

cp file1 ..
it winds up in ~/public_html/, not ~/html/dev/! Is there a way to change this behavior? If not, can someone at least explain the rationale behind it?

alienDog 12-01-2005 04:00 PM

cd .. && cp images/file .

... maybe ;)

Seriously, I don't have the solution but I do admire your problem. I remember reading a plan9 document with title "What's wrong with symlinks" or something like that that might be of help, but unfortunately I'm unable to locate it right now :(

smidgie82 12-21-2005 04:13 PM

Thanks for the reply. I've done some searching since the original post, and I haven't been able to find any explanation for the rationale... I'm gonna do some kernel hacking and see if I can't change this behavior.

I went ahead and changed the thread title to make it more informative. Anyone else have input?

Thanks!


All times are GMT -5. The time now is 01:14 PM.