proposed bsdlabel patch

Ruslan Ermilov ru at FreeBSD.org
Tue Mar 30 02:57:43 PST 2004


On Tue, Mar 30, 2004 at 11:06:41AM +0200, Hartmut Brandt wrote:
> Luigi Rizzo wrote:
> >On Tue, Mar 30, 2004 at 10:17:06AM +0200, Hartmut Brandt wrote:
> >
> >>Marcel Moolenaar wrote:
> >
> >...
> >
> >>>The file takes precedence, because any filename that does not contain
> >>>any directory elements is assumed to live in the current directory. The
> >>>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.
> >
> >
> >it may be secondary, but it has been the historical behaviour for
> >ages and I don't want to hear people rightly screaming for a change
> >that broke a huge number of existing scripts.
> >
> >
> >>That makes it very easy to trash a file in the current directory.
> >
> >
> >that is a minor concern. "rm" has the same problem :)
> 
> Not really. rm has no magic that interpretes da0 as /dev/da0. If you
> happen to have a file da0 in your current directory (let's say the saved
> disklabel or so) and specify just da0 to disklabel expecting that it
> will work on /dev/da0 it will unexpecedly clobber your file. Such
> automatisms make things not easier, but more complex - you have to
> remember them. You need to get the habit to do ls -l before you do
> disklabel da0. I'd say keep the '-f' option, that'll make things clearer.
> 
FWIW, fdisk(8), diskinfo(8), fsck_ffs(8) (and probably others)
prefer the file in the current directory to a /dev entry.


Cheers,
-- 
Ruslan Ermilov
ru at FreeBSD.org
FreeBSD committer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20040330/f09973b7/attachment.bin


More information about the freebsd-current mailing list