Check out the stat function -- it returns a long list of info., which will be of use
to you:
perl -e ' @list=stat("."); foreach(@list){printf "%o \n",$_;} '
The " printf %o " part prints the value in octal, which is what you're after. The
3rd value in the returned array $list[2] is the mode. on my linux box, I get this
output:
1406
644042
40775
27
1046
12
0
4000
7316040631
7315775540
7315775540
10000
4
The 3rd element is the mode...775.
" ls -ald . " shows: drwxrwxr-x 23 mcauthor wheel 2048 Jun 25 23:02
Hope this helps. perldoc -f stat will give you all the nitty gritty on the rest.
Chances are good your script will return much more useful information than you
initially thought!
Matt
--- "PURMONEN, Joni" <[EMAIL PROTECTED]> wrote:
> Hi ya,
>
> I need to check the group status on numerous files/directories, and haven't
> been able to fing out the best way to do it with perl. I simply need to see
> if some directories do not have certain group set on them.
>
> Can anyone give any pointers?
>
> Cheers,
>
> Joni
>
> Ps. I only have learning perl and some other fairly simple books which
> didn't seem to have anything useful in them
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/