Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 May 2006 18:27:47 -0700
From:      John-Mark Gurney <gurney_j@resnet.uoregon.edu>
To:        "gs_stoller@juno.com" <gs_stoller@juno.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: The 'ln -s' command
Message-ID:  <20060524012747.GB49081@funkthat.com>
In-Reply-To: <20060523.182218.19235.1026225@webmail29.nyc.untd.com>
References:  <20060523.182218.19235.1026225@webmail29.nyc.untd.com>

next in thread | previous in thread | raw e-mail | index | archive | help
gs_stoller@juno.com wrote this message on Wed, May 24, 2006 at 01:21 +0000:
> I tried the 'ln -s' command in bothe 4.3  &  4.7  in a situation where it should fail and it did, but it still had a return/exit code of  0 , I think it should have been nonzero.  I tried 'ln -s  a  b' where the file  b  existed (and was a directory) and I wanted to create the file named  a  also pointing to it.  The correct form was 'ln -s  b  a'.
> 
> FreeBSD  4.3-RELEASE FreeBSD 4.3-RELEASE #0: Sat Apr 21 10:54:49 GMT 2001     jkh@narf.osd.bsdi.com:/usr/src/sys/compile/GENERIC  i386
> 
> FreeBSD  4.7-RELEASE FreeBSD 4.7-RELEASE #0: Wed Oct  9 15:08:34 GMT 2002     root@builder.freebsdmall.com:/usr/obj/usr/src/sys/GENERIC  i386

Hmm... I just tried this and I didn't see this behavior on 4.7-R:
-bash-2.05b$ ln -s a z
ln: z: File exists
-bash-2.05b$ echo $?
1
-bash-2.05b$ ln -s z a
-bash-2.05b$ echo $?
0
-bash-2.05b$ uname -a
FreeBSD gate.funkthat.com 4.7-RELEASE FreeBSD 4.7-RELEASE #5: Tue Sep  9 02:05:39 PDT 2003     jmg@gate.funkthat.com:/usr/src/sys/compile/gate  i386

Looks like the EEXIST is returning non-zero...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."



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