public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Dumb symlink question
@ 2006-02-09  7:45 Stroller
  2006-02-09  8:38 ` Neil Bothwick
  2006-02-10  7:42 ` Boyd Stephen Smith Jr.
  0 siblings, 2 replies; 6+ messages in thread
From: Stroller @ 2006-02-09  7:45 UTC (permalink / raw
  To: gentoo-user

This has been bugging me for some time, but I've never gotten around  
to posting about it here before. Why doesn't the symlink get  
overwritten, please? The behaviour I see below seems quite at odds to  
the documentation in the man page (but then, perhaps I simply haven't  
read the mapage properly ;)

    # ln -s -f linux-2.6.15.1 linux
    # ls -l
    total 72
    -rw-r--r--   1 root root 33712 Mar 30  2005 kernel.config.16.3.2005
    -rw-r--r--   1 root root 30167 Oct 17 02:25 kernel.config.17.10.2005
    lrwxrwxrwx   1 root root    22 Feb  7 08:01 linux -> linux-2.6.15- 
gentoo-r1
    drwxr-xr-x  19 root root  1320 Feb  7 08:01 linux-2.6.12-gentoo-r10
    drwxr-xr-x  19 root root  1336 Nov 27 08:06 linux-2.6.14-gentoo-r2
    drwxr-xr-x  20 root root  1392 Feb  9 07:34 linux-2.6.15-gentoo-r1
    drwxr-xr-x  19 root root   712 Feb  9 07:25 linux-2.6.15.1
    # rm linux
    rm: remove symbolic link `linux'? y
    807 /usr/src # ln -s -f linux-2.6.15.1 linux
    808 /usr/src # ls -l
    total 72
    -rw-r--r--   1 root root 33712 Mar 30  2005 kernel.config.16.3.2005
    -rw-r--r--   1 root root 30167 Oct 17 02:25 kernel.config.17.10.2005
    lrwxrwxrwx   1 root root    14 Feb  9 07:37 linux -> linux-2.6.15.1
    drwxr-xr-x  19 root root  1320 Feb  7 08:01 linux-2.6.12-gentoo-r10
    drwxr-xr-x  19 root root  1336 Nov 27 08:06 linux-2.6.14-gentoo-r2
    drwxr-xr-x  20 root root  1392 Feb  9 07:34 linux-2.6.15-gentoo-r1
    drwxr-xr-x  19 root root   712 Feb  9 07:25 linux-2.6.15.1
    #

TIA for any advices,

Stroller
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Dumb symlink question
  2006-02-09  7:45 [gentoo-user] Dumb symlink question Stroller
@ 2006-02-09  8:38 ` Neil Bothwick
  2006-02-10  7:43   ` Boyd Stephen Smith Jr.
  2006-02-10  7:42 ` Boyd Stephen Smith Jr.
  1 sibling, 1 reply; 6+ messages in thread
From: Neil Bothwick @ 2006-02-09  8:38 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 476 bytes --]

On Thu, 9 Feb 2006 07:45:53 +0000, Stroller wrote:

> This has been bugging me for some time, but I've never gotten around  
> to posting about it here before. Why doesn't the symlink get  
> overwritten, please?

ln doesn't overwrite symlinks to directories, although this is not
mentioned in the man page. Either delete the link first, or emerge your
new kernel source with the symlink USE flag.


-- 
Neil Bothwick

Soooo... We are in Law Enforcment. -Worf-

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Dumb symlink question
  2006-02-09  7:45 [gentoo-user] Dumb symlink question Stroller
  2006-02-09  8:38 ` Neil Bothwick
@ 2006-02-10  7:42 ` Boyd Stephen Smith Jr.
  1 sibling, 0 replies; 6+ messages in thread
From: Boyd Stephen Smith Jr. @ 2006-02-10  7:42 UTC (permalink / raw
  To: gentoo-user

On Thursday 09 February 2006 01:45, Stroller 
<stroller@stellar.eclipse.co.uk> wrote about '[gentoo-user] Dumb symlink 
question':
> This has been bugging me for some time, but I've never gotten around
> to posting about it here before. Why doesn't the symlink get
> overwritten, please? The behaviour I see below seems quite at odds to
> the documentation in the man page (but then, perhaps I simply haven't
> read the mapage properly ;)

Since your destination is a directory (albeit actually a symlink to one), 
ln thinks you want to put the link *in* that directory, with the same name 
as the original.  [Compare cp and mv.]

I know you can fix this with the -n flag to ln, but I can't really remember 
what -n stands for.  (It is in the man page, of course.)

-- 
Boyd Stephen Smith Jr.
bss03@volumehost.com
ICQ: 514984 YM/AIM: DaTwinkDaddy
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Dumb symlink question
  2006-02-09  8:38 ` Neil Bothwick
@ 2006-02-10  7:43   ` Boyd Stephen Smith Jr.
  2006-02-14 21:14     ` Neil Bothwick
  0 siblings, 1 reply; 6+ messages in thread
From: Boyd Stephen Smith Jr. @ 2006-02-10  7:43 UTC (permalink / raw
  To: gentoo-user

On Thursday 09 February 2006 02:38, Neil Bothwick <neil@digimed.co.uk> 
wrote about 'Re: [gentoo-user] Dumb symlink question':
> On Thu, 9 Feb 2006 07:45:53 +0000, Stroller wrote:
> > This has been bugging me for some time, but I've never gotten around
> > to posting about it here before. Why doesn't the symlink get
> > overwritten, please?
>
> ln doesn't overwrite symlinks to directories, although this is not
> mentioned in the man page. Either delete the link first, or emerge your
> new kernel source with the symlink USE flag.

That's just not true.  Heck, I thought you were the one that told me about 
the -n flag (see my other post), Neil.

-- 
Boyd Stephen Smith Jr.
bss03@volumehost.com
ICQ: 514984 YM/AIM: DaTwinkDaddy
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Dumb symlink question
  2006-02-10  7:43   ` Boyd Stephen Smith Jr.
@ 2006-02-14 21:14     ` Neil Bothwick
  2006-02-14 21:34       ` Boyd Stephen Smith Jr.
  0 siblings, 1 reply; 6+ messages in thread
From: Neil Bothwick @ 2006-02-14 21:14 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 634 bytes --]

On Fri, 10 Feb 2006 01:43:21 -0600, Boyd Stephen Smith Jr. wrote:

> > ln doesn't overwrite symlinks to directories, although this is not
> > mentioned in the man page. Either delete the link first, or emerge
> > your new kernel source with the symlink USE flag.
> 
> That's just not true.  Heck, I thought you were the one that told me
> about the -n flag (see my other post), Neil.

Not me, -n is a new one to me. However, my statement was partly true, the
man page doesn't mention that -f doesn't overwrite links to directories.


-- 
Neil Bothwick

If everything is coming your way then you're in the wrong lane.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Dumb symlink question
  2006-02-14 21:14     ` Neil Bothwick
@ 2006-02-14 21:34       ` Boyd Stephen Smith Jr.
  0 siblings, 0 replies; 6+ messages in thread
From: Boyd Stephen Smith Jr. @ 2006-02-14 21:34 UTC (permalink / raw
  To: gentoo-user

On Tuesday 14 February 2006 15:14, Neil Bothwick <neil@digimed.co.uk> wrote 
about 'Re: [gentoo-user] Dumb symlink question':
> On Fri, 10 Feb 2006 01:43:21 -0600, Boyd Stephen Smith Jr. wrote:
> > > ln doesn't overwrite symlinks to directories, although this is not
> > > mentioned in the man page. Either delete the link first, or emerge
> > > your new kernel source with the symlink USE flag.
> >
> > That's just not true.  Heck, I thought you were the one that told me
> > about the -n flag (see my other post), Neil.
>
> Not me, -n is a new one to me. However, my statement was partly true,
> the man page doesn't mention that -f doesn't overwrite links to
> directories.

That's because this case falls under the case "the the target is a 
directory, make the symlink in (not as) the directory".  In fact check 
this out:

$ find | xargs ls -ld
drwxr-xr-x 4 bss03 users 100 Feb 14 15:31 .
drwxr-xr-x 2 bss03 users  40 Feb 14 15:30 ./bar
lrwxrwxrwx 1 bss03 users   3 Feb 14 15:31 ./baz -> bar
drwxr-xr-x 3 bss03 users  60 Feb 14 15:30 ./foo
drwxr-xr-x 2 bss03 users  40 Feb 14 15:30 ./foo/foo
$ ln -sf foo baz
$ find | xargs ls -ld
drwxr-xr-x 4 bss03 users 100 Feb 14 15:31 .
drwxr-xr-x 2 bss03 users  60 Feb 14 15:31 ./bar
lrwxrwxrwx 1 bss03 users   3 Feb 14 15:31 ./bar/foo -> foo
lrwxrwxrwx 1 bss03 users   3 Feb 14 15:31 ./baz -> bar
drwxr-xr-x 3 bss03 users  60 Feb 14 15:30 ./foo
drwxr-xr-x 2 bss03 users  40 Feb 14 15:30 ./foo/foo
$ ln -sf foo/foo baz
$ find | xargs ls -ld
drwxr-xr-x 4 bss03 users 100 Feb 14 15:31 .
drwxr-xr-x 2 bss03 users  60 Feb 14 15:32 ./bar
lrwxrwxrwx 1 bss03 users   7 Feb 14 15:32 ./bar/foo -> foo/foo
lrwxrwxrwx 1 bss03 users   3 Feb 14 15:31 ./baz -> bar
drwxr-xr-x 3 bss03 users  60 Feb 14 15:30 ./foo
drwxr-xr-x 2 bss03 users  40 Feb 14 15:30 ./foo/foo

See, it will overwrite a link to a directory.

-- 
Boyd Stephen Smith Jr.
bss03@volumehost.com
ICQ: 514984 YM/AIM: DaTwinkDaddy
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-02-14 21:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-09  7:45 [gentoo-user] Dumb symlink question Stroller
2006-02-09  8:38 ` Neil Bothwick
2006-02-10  7:43   ` Boyd Stephen Smith Jr.
2006-02-14 21:14     ` Neil Bothwick
2006-02-14 21:34       ` Boyd Stephen Smith Jr.
2006-02-10  7:42 ` Boyd Stephen Smith Jr.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox