Derek Martin wrote: > I'd use Python or C (or <shudder> Perl for this). > >>>> import stat, os >>>> mode = os.stat(".bashrc") >>>> print ((mode.st_mode | stat.S_IWGRP) and mode.st_gid == 0) > False
Shudder yourself. This operation is perfectly legible in Perl: use File::stat; use Fcntl qw(S_IWGRP S_IWOTH); # import fcntl.h symbols my $fs = stat($filename); print "$filename is group or other writable\n" if $fs && $fs->mode & (S_IWGRP | S_IWOTH); (Are you sure your code tests that the file is group or other writable? You seem to be only testing for group write and that the group owner is root.) -Tom -- Tom Metro Venture Logic, Newton, MA, USA "Enterprise solutions through open source." Professional Profile: http://tmetro.venturelogic.com/ _______________________________________________ Discuss mailing list Discuss@blu.org http://lists.blu.org/mailman/listinfo/discuss