in reply to Re: How to chgrp in perl?
in thread How to chgrp in perl?

The solutions i saw, searching Perlmonks, use chown and numerical-IDs. They resolve these by using getpwnam. I'd like to enhance my script, described in Using perl for creating project folders, in a way that it is possible to declare group rights in the xml-schema. It is much more flexible if i can use groupnames instead of numerical IDs.

Replies are listed 'Best First'.
Re: Re: Re: How to chgrp in perl?
by Aragorn (Curate) on Apr 04, 2004 at 13:58 UTC
    getgrnam, in scalar context, returns the group ID of the named group:
    my $gid = getgrnam("users");
    Now you can use the chown function.

    perldoc -f getgrnam gives more detailed information about getgrnam (and its sibling functions).

    Arjen

      That really helps me.
      Thanks a lot!

      neniro