Unix Programming - How to get user and group names from uid and gid

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > April 2004 > How to get user and group names from uid and gid





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author How to get user and group names from uid and gid
Mike

2004-04-19, 2:34 am

Hi guys,

I used to stat() to get st_uid and st_gid for an entry in a directory.
How can I get the corresponding user name/id and group name/id. I
know there are two functions like getpwuid() and getgrgid() but I
couldn't get them to work. What library is getgrgid() anyways?? Help
will be much appreciated. Thanks
music4

2004-04-19, 5:34 am

getpwuid is working pretty fine in my program. Just include <pwd.h>. I work
on Solaris 2.7 & 2.8.


"Mike" <ulflong@yahoo.com> wrote in message
news:837d9c7e.0404182208.7ee573f6@posting.google.com...
> Hi guys,
>
> I used to stat() to get st_uid and st_gid for an entry in a directory.
> How can I get the corresponding user name/id and group name/id. I
> know there are two functions like getpwuid() and getgrgid() but I
> couldn't get them to work. What library is getgrgid() anyways?? Help
> will be much appreciated. Thanks



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com