Dear god, you guys really like hurting yourselves. If filetest doesn't do it, why not just something on the order of:
#include <sys/types.h> #include <sys/stat.h> 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: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]] On Behalf Of Paul Herman > Sent: Saturday, May 18, 2002 11:45 PM > To: Giorgos Keramidas > Cc: Benjamin P. Grubin; [EMAIL PROTECTED] > 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 [EMAIL PROTECTED] > with "unsubscribe freebsd-current" in the body of the message > > > To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message