help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to make symbolic links?


From: Philip Guenther
Subject: Re: how to make symbolic links?
Date: Wed, 7 Sep 2011 23:22:32 -0700

On Wed, Sep 7, 2011 at 10:45 PM, Mark Galeck (CW) <address@hidden> wrote:
>>>ln -s dir1/foobar1 dir/foobar
>
>  >works as expected.
>
> Philip wrote:
>>No, it doesn't.
>
> Yes it does!
>
> address@hidden: ls -d dir*
> dir  dir1
> address@hidden: ls dir1
> foobar1
> address@hidden: ln -s dir1/foobar1 dir/foobar
> address@hidden: ls -l dir/foobar
> lrwxrwxrwx 1 mgaleck sw-team 12 Sep  7 22:42 dir/foobar -> dir1/foobar1
> address@hidden:

How many commands did you run that actually *open* dir/foobar?

$ cd /tmp/f
$ l
total 4
drwxrwxr-x  2 guenther  wheel  512 Sep  7 23:18 .
drwxrwxrwt  7 root      wheel  512 Sep  7 22:26 ..
$ mkdir dir dir1
$ echo "this is dir1" > dir1/foobar1
$ mkdir dir/dir1
$ echo "surprise, this is dir/dir1" > dir/dir1/foobar1
$ ln -s dir1/foobar1 dir/foobar
$ ls -d dir*
dir  dir1
$ ls -l dir/foobar
lrwxrwxr-x  1 guenther  wheel  12 Sep  7 23:19 dir/foobar -> dir1/foobar1
$ cat dir/foobar
surprise, this is dir/dir1
$ cd dir
$ cat foobar
surprise, this is dir/dir1
$ cd ../..
$ cat f/dir/foobar
surprise, this is dir/dir1
$


So, what EFFECTIVE FULL PATH does dir/foobar point to?  Is that what
you intended it to point to?


Philip Guenther



reply via email to

[Prev in Thread] Current Thread [Next in Thread]