Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Jun 1997 16:36:55 -0700 (PDT)
From:      Christopher G Mann <r3cgm@cdrom.com>
To:        questions@freebsd.org
Subject:   ln behavior
Message-ID:  <199706152336.QAA04048@pooh.cdrom.com>

next in thread | raw e-mail | index | archive | help
Greetings...

I'm curious why the "-f" parameter for "ln" does not work with directories
under FreeBSD 2.2.x.

I.e. Files work...

[hornet : r3cgm] ~/test - touch file1 file2

-rw-r--r--   1 r3cgm  r3cgm     0 Jun 15 15:32 file1
-rw-r--r--   1 r3cgm  r3cgm     0 Jun 15 15:32 file2

[hornet : r3cgm] ~/test - ln -s file1 file.symbolic

lrwxr-xr-x   1 r3cgm  r3cgm     5 Jun 15 15:32 file.symbolic@ -> file1
-rw-r--r--   1 r3cgm  r3cgm     0 Jun 15 15:32 file1
-rw-r--r--   1 r3cgm  r3cgm     0 Jun 15 15:32 file2

[hornet : r3cgm] ~/test - ln -fs file2 file.symbolic

lrwxr-xr-x   1 r3cgm  r3cgm     5 Jun 15 15:33 file.symbolic@ -> file2
-rw-r--r--   1 r3cgm  r3cgm     0 Jun 15 15:32 file1
-rw-r--r--   1 r3cgm  r3cgm     0 Jun 15 15:32 file2

But Directories don't...

[hornet : r3cgm] ~/test - mkdir dir1 dir2

drwxr-xr-x   2 r3cgm  r3cgm   512 Jun 15 15:34 dir1/
drwxr-xr-x   2 r3cgm  r3cgm   512 Jun 15 15:34 dir2/

[hornet : r3cgm] ~/test - ln -s dir1 dir.symbolic

lrwxr-xr-x   1 r3cgm  r3cgm     4 Jun 15 15:34 dir.symbolic@ -> dir1
drwxr-xr-x   2 r3cgm  r3cgm   512 Jun 15 15:34 dir1/
drwxr-xr-x   2 r3cgm  r3cgm   512 Jun 15 15:34 dir2/

[hornet : r3cgm] ~/test - ln -fs dir2 dir.symbolic

lrwxr-xr-x   1 r3cgm  r3cgm     4 Jun 15 15:34 dir.symbolic@ -> dir1 <-- Bzzt!
drwxr-xr-x   2 r3cgm  r3cgm   512 Jun 15 15:34 dir1/
drwxr-xr-x   2 r3cgm  r3cgm   512 Jun 15 15:34 dir2/

I can't seem to find anything in the man pages that indicates why ln would
behave this way.

Looking forward to your reply..

--
Christopher G. Mann - r3cgm@cdrom.com
Walnut Creek CDROM



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199706152336.QAA04048>