Date: Mon, 15 Dec 2003 15:50:49 +0600 From: Alexey Dokuchaev <danfe@nsu.ru> To: Peter Jeremy <PeterJeremy@optushome.com.au> Cc: cvs-src@freebsd.org Subject: Re: cvs commit: src Makefile.inc1 Message-ID: <20031215095049.GA78800@regency.nsu.ru> In-Reply-To: <20031215083703.GB956@cirb503493.alcatel.com.au> References: <xzp7k101xfd.fsf@dwp.des.no> <200312141136.hBEBa2pD043994@grimreaper.grondar.org> <20031215083703.GB956@cirb503493.alcatel.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Dec 15, 2003 at 07:37:04PM +1100, Peter Jeremy wrote: > On Sun, Dec 14, 2003 at 11:36:02AM +0000, Mark Murray wrote: > >Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= writes: > >> It uses Perl directly to compute the numeric mode of a file. The > >> version in -CURRENT uses a combination of stat(1), bc(1) and shell > >> arithmetic which causes a syntax error in 4.x. > >> > >> Personally, I think it would be best if stat(1) could gain an option > >> (-m perhaps) that makes it simply print its arguments' modes in octal. > > > >Does 4.x's stat(1) have the "-s" switch? If so: > > > >$ ( eval $(stat -s .profile) ; printf "%o %s\n" ${st_mode} ${st_mode} ) > >100644 0100644 > > > >Would that be any use? > > Not in the absence of stat(1) :-(. As an alternative, maybe ls(1) > could grow an option to spit out the mode in octal - assuming there > are any spare opton letters left. The simplest solution would seem > to be to MFC stat(1) to 4.x. The only other alternative would be a > (messy) awk script to convert the mode letters in 'ls -l' output to > an octal number. Frankly, adding an option to ls(1) or writing ls(1) -l/awk(1) combo takes my vote, rather than adding yet another foo(1) utility to the base; especially provided that its functionality isn't strictly orthogonal. Just my $.02. ./danfe
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031215095049.GA78800>