From: gga Date: 2007-06-24T06:55:06+09:00 Subject: Re: Secondary user groups On Jun 23, 6:27 pm, gga wrote: > require 'etc' > Etc.getpwnam(user) > > or, using Daniel Berger's std-admin library_ > > require 'sys/admin' > Sys::Admin.get_user(user) > > allows me to get a struct with the user's primary group. > > However, I need to obtain the list of ALL groups that a user belongs > to (primary and secondary). > Other than doing the unportable: > > groups = `groups #{user}`.split > > is there a method in the ruby std library to get the secondary groups? Never mind. Found how to do it.