Re: Changing target for a symbolic link



googler wrote:

> Aragorn wrote:
>>
>> One single line...:
>>
>> rm -f link2 && ln -s new.text link2
>>
>> /rm/ does not remove the file the symlink points to. It only removes
>> the link.
>>
>> Hope this helps... ;-)
>
> Thank you, but I was wondering if deleting link2 makes link1 unstable
> in any way, does it? So when I want to access new.txt through link1, is
> there a possibility that it won't work?

Oh, no. If you delete /link2/, then /link1/ will be a dangling symlink (a
symlink that points to a non-existant location) until /link2/ exists again.
Simply that. Obviously, while /link2/ is absent (milliseconds, if you do
the above one-liner), any try to access /link1/, you would get an error
along the lines of "error: file link2 not found".

However, don't believe me: go ahead and try it with some test files!

--
Iñaki Silanes / Chemistry Faculty UPV-EHU Donostia
http://www.sc.ehu.es/powgep99/dcytp/teoricos/staff/inaki/inaki.htm
On Intelligent Design: http://www.venganza.org/
.