user and group names from uid and gid
The title kinda says it all. I know that stat() in C or C++ will give me, amongst other things, the uid of the owner and the gid of the file. But how do I translate the integer uid into a name? The specific implementation I'm looking at is C++, but C ways of doing this work too.
Thanks. |
Correlate it by looking it up in /etc/passwd and /etc/group respectively?
Cheers, Tink |
getgrgid() and getpwuid() for group and user name translation.
|
Thanks! Just what I was looking for.
|
All times are GMT -5. The time now is 12:00 AM. |