From owner-freebsd-current Sat May 18 21: 5: 6 2002 Delivered-To: freebsd-current@freebsd.org Received: from mail.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by hub.freebsd.org (Postfix) with ESMTP id 1B16537B406 for ; Sat, 18 May 2002 21:04:59 -0700 (PDT) Received: (qmail 19234 invoked from network); 19 May 2002 04:04:58 -0000 Received: from unknown (HELO VINZCLORTHO) ([66.92.70.186]) (envelope-sender ) by mail11.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 19 May 2002 04:04:58 -0000 From: "Benjamin P. Grubin" To: "'Paul Herman'" , "'Giorgos Keramidas'" Cc: Subject: RE: mergemaster(8) broken -- uses Perl Date: Sun, 19 May 2002 00:04:56 -0400 Message-ID: <002e01c1feea$599cb890$080aa8c0@VINZCLORTHO> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 In-Reply-To: <20020518203835.W923-100000@mammoth.eat.frenchfries.net> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Dear god, you guys really like hurting yourselves. If filetest doesn't do it, why not just something on the order of: #include #include main (argc, argv) int argc; char *argv[]; { struct stat stbuf; if (!stat(argv[1], &stbuf)) printf("%o\n", stbuf.st_mode); else printf("error: stat failed\n"); } Cheers, Ben > -----Original Message----- > From: owner-freebsd-current@FreeBSD.ORG > [mailto:owner-freebsd-current@FreeBSD.ORG] On Behalf Of Paul Herman > Sent: Saturday, May 18, 2002 11:45 PM > To: Giorgos Keramidas > Cc: Benjamin P. Grubin; current@FreeBSD.ORG > Subject: Re: mergemaster(8) broken -- uses Perl > > > On Sun, 19 May 2002, Giorgos Keramidas wrote: > > > On 2002-05-18 23:11, Benjamin P. Grubin wrote: > > > Giorgos Keramidas wrote: > > > > > > > > [ The above should print in stdout just 01777 as a number. ] > > > > ... > > > > Does anyone know of any other (possibly more elegant way) of > > > > reading the numeric value of the permission bits for a file? > > Hmmm, it's ugly but perhaps not as ugly: > > bash$ fstat -n /kernel < /kernel | grep -v PID > pherman fstat 942 0 116,196608 235 100555 > 4114305 r /kernel > > (the 100555). The bad side is that you'd have to do a little > trickery to catch the correct process. It'd probably be better > just to add an option to fstat to display /usr/ports/sysutils/stat > type info... > > -Paul. > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-current" in the body of the message > > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message