Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Mar 2004 21:38:18 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Marcel Moolenaar <marcel@xcllnt.net>
Cc:        current@FreeBSD.org
Subject:   Re: proposed bsdlabel patch
Message-ID:  <20040330212234.B10192@gamplex.bde.org>
In-Reply-To: <20040330080250.GA69610@dhcp01.pn.xcllnt.net>
References:  <20040329163926.A38109@xorpc.icir.org> <20040330005013.GA53546@ns1.xcllnt.net> <20040329234212.A72990@xorpc.icir.org> <20040330080250.GA69610@dhcp01.pn.xcllnt.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 30 Mar 2004, Marcel Moolenaar wrote:

> On Mon, Mar 29, 2004 at 11:42:12PM -0800, Luigi Rizzo wrote:
> > actually, following up to myself:
> >
> > you do need some way to disambiguate between the case of a device
> > ("bsdlabel ad0") and a file in the current directory ("bdslabel
> > ad0").

The absolute path hack is a bad way to do this.  It depends on the
historical brokenness of adding a /dev prefix to the pathname unless
the pathname begins with a leading slash.

> The file takes precedence, because any filename that does not contain
> any directory elements is assumed to live in the current directory. The

So should any pathname that doesn't contain a leading slash (e.g., ./foo,
or foo/bar).

> shorthand for device special files is secundairy to that, because it's
> a convenience only. If the device special file is meant, it has to be
> specified as /dev/ad0 in the example given.

Unfortunately, disklabel never worked like that, and bsdlabel inherited
most of disklabel's bugs and added more.

%%%
Script started on Tue Mar 30 21:37:05 2004
ttyp0:bde@besplex:/tmp> touch foo
ttyp0:bde@besplex:/tmp> bsdlabel foo
bsdlabel: /dev/foo: No such file or directory
ttyp0:bde@besplex:/tmp> bsdlabel ./foo
bsdlabel: /dev/./foo: No such file or directory
ttyp0:bde@besplex:/tmp> exit

Script done on Tue Mar 30 21:37:17 2004
%%%

Bruce



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